nodeguy/28c02e55.3bd42139.js
2021-11-26 17:46:30 +00:00

1 line
9.0 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{135:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"rightToc",(function(){return c})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(6),a=(n(0),n(467)),i={},l={unversionedId:"development/setting-up",id:"development/setting-up",isDocsHomePage:!1,title:"setting-up",description:"Setup project for development",source:"@site/docs/development/setting-up.md",slug:"/development/setting-up",permalink:"/docs/development/setting-up",editUrl:"https://github.com/nodegui/nodegui/edit/master/website/docs/development/setting-up.md",version:"current"},c=[{value:"Development setup and getting started",id:"development-setup-and-getting-started",children:[{value:"MacOSX:",id:"macosx",children:[]},{value:"Windows:",id:"windows",children:[]},{value:"Linux:",id:"linux",children:[]},{value:"Common:",id:"common",children:[]}]}],p={rightToc:c};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h1",{id:"setup-project-for-development"},"Setup project for development"),Object(a.b)("h2",{id:"development-setup-and-getting-started"},"Development setup and getting started"),Object(a.b)("p",null,"Make sure you follow the setup guide of ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/nodegui/qode"}),"Qode")," so that you have a build environment ready for Qode."),Object(a.b)("h3",{id:"macosx"},"MacOSX:"),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},"Requirements")),Object(a.b)("ol",null,Object(a.b)("li",{parentName:"ol"},"Node version: > 11"),Object(a.b)("li",{parentName:"ol"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(a.b)("li",{parentName:"ol"},"Make, GCC v7"),Object(a.b)("li",{parentName:"ol"},"Qt (",Object(a.b)("em",{parentName:"li"},"Optional"),"): Make sure you followed the setup instructions from ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://github.com/nodegui/qode"}),"Qode"))),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},Object(a.b)("em",{parentName:"strong"},"Only for M1 Macs"))),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},Object(a.b)("em",{parentName:"strong"},"Setting up Qt:"))),Object(a.b)("p",null,"You will need to download and install Qt from source since there are no binaries from Qt for M1 yet. "),Object(a.b)("p",null,"(",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/"}),"https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/"),")"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{}),"git clone git://code.qt.io/qt/qt5.git\ncd qt5\ngit checkout 5.15\n\n./init-repository --module-subset=essential -f\ngit submodule init qtsvg\ngit submodule update qtsvg\n\ncd ..\nmkdir qt5-5.15-macOS-release\ncd qt5-5.15-macOS-release\n\n../qt5/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript\n\nmake -j15\n\nmake install\n")),Object(a.b)("p",null,"This should install Qt into something like this ",Object(a.b)("inlineCode",{parentName:"p"},"/usr/local/Qt-5.15.3")," (your directory can change. This will be displayed when running make)"),Object(a.b)("p",null,"Now just set ",Object(a.b)("inlineCode",{parentName:"p"},"export QT_INSTALL_DIR=/usr/local/Qt-5.15.3")," in either your .zshrc or .bashrc"),Object(a.b)("p",null,"Further steps would now use this custom Qt installation."),Object(a.b)("h3",{id:"windows"},"Windows:"),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},"Requirements")),Object(a.b)("ol",null,Object(a.b)("li",{parentName:"ol"},"Node version: > 11"),Object(a.b)("li",{parentName:"ol"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(a.b)("li",{parentName:"ol"},"Visual Studio Community 2017"),Object(a.b)("li",{parentName:"ol"},"Powershell"),Object(a.b)("li",{parentName:"ol"},"Qt (",Object(a.b)("em",{parentName:"li"},"Optional"),"): Make sure you followed the setup instructions from ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://github.com/nodegui/qode"}),"Qode"))),Object(a.b)("h3",{id:"linux"},"Linux:"),Object(a.b)("p",null,"Supported versions: Ubuntu 17.10 and up"),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},"Requirements")),Object(a.b)("ol",null,Object(a.b)("li",{parentName:"ol"},"Node version: > 11"),Object(a.b)("li",{parentName:"ol"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(a.b)("li",{parentName:"ol"},"Make, GCC v7, pkg-config"),Object(a.b)("li",{parentName:"ol"},"Qt (",Object(a.b)("em",{parentName:"li"},"Optional"),"): Make sure you followed the setup instructions from ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://github.com/nodegui/qode"}),"Qode"))),Object(a.b)("p",null,"On Ubuntu: ",Object(a.b)("inlineCode",{parentName:"p"},"$ sudo apt-get install pkg-config build-essential")," should install everything except Qt5."),Object(a.b)("p",null,"Note: If you are using your own version of Qt make sure to"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},'export PKG_CONFIG_PATH="<path to qt installation>/5.13.0/gcc_64/lib/pkgconfig"')),Object(a.b)("h3",{id:"common"},"Common:"),Object(a.b)("ol",null,Object(a.b)("li",{parentName:"ol"},"Once you have setup the platform specific stuff as mentioned above, follow these:"),Object(a.b)("li",{parentName:"ol"},Object(a.b)("inlineCode",{parentName:"li"},"git clone")," this repo."),Object(a.b)("li",{parentName:"ol"},Object(a.b)("inlineCode",{parentName:"li"},"yarn install")),Object(a.b)("li",{parentName:"ol"},Object(a.b)("inlineCode",{parentName:"li"},"yarn build:addon")),Object(a.b)("li",{parentName:"ol"},Object(a.b)("inlineCode",{parentName:"li"},"yarn dev"))),Object(a.b)("p",null,"If you want to run with your own version of Qt make sure to pass qt_home_dir variable when building addon."),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"npm run rebuild:addon [--qt_home_dir=/path/to/qt]")))}s.isMDXComponent=!0},467:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=o.a.createContext({}),s=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},b=function(e){var t=s(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),b=s(n),m=r,d=b["".concat(i,".").concat(m)]||b[m]||u[m]||a;return n?o.a.createElement(d,l(l({ref:t},p),{},{components:n})):o.a.createElement(d,l({ref:t},p))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var p=2;p<a;p++)i[p]=n[p];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);