0

I want to integrate a web application based on react to my buildroot firmware. I Know that I should create a new package with Config.in and file.mk and a daemon Sfile. My question is what to configure in Config.in and file.mk, in order to compile the package correctly under buildroot.

this is my package.json file

dependencies: {
  "@chakra-ui/alert": "^2.0.9",
  "@chakra-ui/react": "^2.3.2",
  "@headlessui/react": "^1.6.6",
  "@heroicons/react": "^1.0.6",
  "@progress/kendo-react-dropdowns": "^5.5.0",
  "@testing-library/jest-dom": "^5.16.4",
  "@testing-library/react": "^13.3.0",
  "@testing-library/user-event": "^13.5.0",
  "@userfront/react": "^0.3.1",
  "axios": "^0.27.2",
  "bootstrap": "^5.1.3",
  "core-util-is": "^1.0.3",
  "dayjs": "^1.11.5",
  "heroicons": "^2.0.10",
  "heroicons-react": "^1.4.1",
  "i18next": "^21.9.1",
  "i18next-browser-languagedetector": "^6.1.5",
  "i18next-http-backend": "^1.4.1",
  "react": "^18.2.0",
  "react-bootstrap": "^2.5.0",
  "react-dom": "^18.2.0",
  "react-i18next": "^11.18.5",
  "react-router-dom": "^5.2.0",
  "react-scripts": "^5.0.1",
  "react-table": "^7.8.0",
  "web-vitals": "^2.1.4"
},
"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
},
"eslintConfig": {
  "extends": [
    "react-app",
    "react-app/jest"
  ]
},
"browserslist": {
  "production": [
    ">0.2%",
    "not dead",
    "not op_mini all"
  ],
  "development": [
    "last 1 chrome version",
    "last 1 firefox version",
    "last 1 safari version"
  ]
},
"devDependencies": {
  "cors": "^2.8.5",
  "express": "^4.18.1",
  "tailwindcss": "^3.1.8"
}

I expect during compile, node module will be installed under the target and I'm able to lunch npm start under the board.

ospiti
  • 11
  • 1

1 Answers1

0

The makefile can be in the following format

PACKAGE_NAME_VERSION = git SHA1 ID
PACKAGE_NAME_SITE = $(call YOUR_REPO-git,PROJECT_NAME)
PACKAGE_NAME_SUBDIR = SOME_PATH

REACT_APP_SITE_METHOD = git
REACT_APP_DEPENDENCIES = nodejs
REACT_APP_INSTALL_STAGING = YES

define REACT_APP_INSTALL_TARGET_CMDS
    $(NPM) install -g $(@D)/SOME_PATH
endef

$(eval $(generic-package))
ospiti
  • 11
  • 1