Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to cross compile #8

Closed
beef331 opened this issue Apr 1, 2022 · 1 comment
Closed

Document how to cross compile #8

beef331 opened this issue Apr 1, 2022 · 1 comment

Comments

@beef331
Copy link
Contributor

beef331 commented Apr 1, 2022

Probably not a major concern presently but it'd be nice to easily cross compile. Debian derived distros do not have an easy process as they do not have a mingw64-gtk-3.0 package. So perhaps this bundle can help streamline the process.

I did use it with the following flags to generate a statically linked binary, but fairly certain that I just abused the C compiler as I could not launch the binary in Wine.

when defined mingw:
  --passL:"-static -lnetapi32 -lmoldname -lmqlogmgr -llinkinfo -lwebclnt -lrastls -lwebpdecoder -lcryptdlg -ld3dcompiler_38 -lksuser -lopengl32 -ldbghelp -lidq -lmingw32 -ldmconfig -lisign32 -lumpnpmgr -lusbcamd2 -linseng -lwiaservc -lcrypt32 -ld3dx10 -lrasppp -lmsrle32 -lmlang -lpolicman -lpng -ldsound -lmiglibnt -lwinsta -lfxsroute -lperfdisk -lsetupqry -luserenv -lperfnet -luniplat -lsyssetup -lwscsvc -lhttpapi -lpdh -lxapofx -limjputyc -losuninst -lmsisip -lsoftpub -latkmm-1.6 -lvssapi -ltraffic -lmmfutil -lxapofx1_1 -lpsapi -leappgnui -lmsdrm -lx3daudio1_6 -luuid -lcnetcfg -lperfos -lsysinv -lfxsdrv -lfreetype -lharfbuzz-gobject -lpixman-1 -lcryptsvc -lcmutil -lcatsrvut -lavifil32 -lurl -ldmvdsitf -lksecdd -lwinfax -licmui -lgdkmm-3.0 -lmf3216 -lmll_qic -lrtutils -lwofutil -ldpnet -lmodemui -lwow64cpu -lrdpcfgex -limskdic -lmf -lhmmapi -lmsasn1 -ltxfw32 -liashlpr -lntshrui -lmdminst -ld3d10 -lkeymgr -lharfbuzz_too -lmsdmo -lmsvcr120_app -ld3dcompiler_36 -ltiffxx -latrace -lwecapi -lbrowser -lmsoledbsql -lloghours -ld3dx9_40 -lshscrap -ld3dx9_30 -lphotowiz -lsynceng -lmtxdm -lmsvcr90 -lclfsw32 -lmobsync -lxinput9_1_0 -ld3dx10_33 -lmsadcs -ld3dx9_26 -lmsgrocm -lbootvid -ltiff -licwdl -lmsftedit -lappmgmts -lodbccp32 -ldwmapi -ld3dxof -lrasmontr -lmcastmib -lmsvidc32 -lsfcfiles -lwdigest -lperfproc -lpangomm-1.4 -lfastprox -lwshbth -lfontconfig -lmtxoci -lCINTIME -lwab32 -lcrtdll -lpangoft2-1.0 -lrstrtmgr -lupnp -lfxsperf -lsqlsrv32 -ld3dcompiler_33 -lwlanapi -ldhcpcsvc6 -lnshipsec -lnetman -lssinc -lopends60 -ld3dx11_42 -lpcre -lxapofx1_0 -lsetupapi -lmciqtz32 -ltsd32 -lmag_hook -lmslbui -lavrt -ld3dx9_24 -lsnprfdll -lrasmans -lntprint -lmigism -liissuba -lsamlib -ld3dx9_43 -liisui -ldbnmpntw -liprop -lncxpnt -llsasrv -lrpcss -ld3dx10_41 -lmll_mtf -lncobjapi -lwinmm -lntdllcrt -lwamreg -lcryptdll -leapphost -lrpcns4 -lktmw32 -lcredui -lmsgsvc -lwiarpc -linfocomm -loakley -lmmdevapi -lodbccu32 -ld2d1 -lsrrstr -lfcachdll -lacledit -ld3dx10_34 -luxtheme -lglu32 -ld3dcompiler_46 -lsensapi -lcmcfg32 -lmssign32 -ld3dx10_40 -lprintui -lmstlsapi -limeshare -ld3dx10_43 -lmsgr3en -lwdsupgcompl -lcairo-script-interpreter -ld3dx10_35 -lcorpol -lwldap32 -lwinhttp -lclasspnp -ld3dx9_42 -lsapi -lmsvcirt -lmsdadiag -lmsimtf -lpstorec -lscrobj -lftpmib -ld3dx10_36 -lglmf32 -lvmx_mode -lwsdapi -lwlanui -lfmifs -lx3daudio -laclui -llzo2 -lgdiplus -lwslapi -lbluetoothapis -lloadperf -lwdsimage -lhypertrm -lgiomm-2.4 -lmgmtapi -ldmivcitf -lappmgr -ladmparse -lntmarta -lcdfview -lserwvdrv -luntfs -ld3dx9 -locgen -lfreetype_too -lpathcch -ltapiperf -lntvdm64 -lwebsocket -lwpd_ci -lnetui0 -lwdsclient -lmapistub -ldbnetlib -lmsoeacct -ldhcpsapi -lmfc42 -lmll_hp -lsspicli -lmsvcr100 -lgmodule-2.0 -lquartz -ltsoc -levntagnt -lwtsapi32 -lsclgntfy -lwdscore -lhbaapi -lrpcdiag -luser32 -lusbport -liiscfg -lwevtapi -lefsadu -ld3dx11 -lnetio -lapphelp -lrasctrs -lodbccr32 -lgcrypt -ljpeg -liassvcs -lwlnotify -lsynchronization -liernonce -lasycfilt -locmanage -locmsn -lccfgnt -lmswsock -lpowrprof -lfxstiff -lshsvcs -lriched20 -lwinusb -liassam -lodbctrac -lsccbase -lcabinet -lw32time -lucrtbase -lcoadmin -lusp10 -lfldrclnr -ltdh -lexpat -lsqlxmlx -lumdmxfrm -linput -linetcomm -lwebcheck -ld3dcompiler_42 -lscesrv -lwlstore -lwebpmux -ladmwprox -lftpctrs2 -liedkcs32 -limm32 -lgmon -ld3dx9_29 -lscecli -lieencode -lactiveds -lmpr -ldpnaddr -lgpg-error -lxapofx1_5 -lstaxmem -lmsado15 -loleacc -lmsctfmonitor -ldrprov -lrasman -lrasadhlp -lcomuid -lpcrecpp -lp2pgraph -lwinspool -lUNIDRVUI -ldavclnt -lmtxex -lvfw32 -lhotplug -lsecur32 -limsinsnt -lpcreposix -ldciman32 -lgtkmm-3.0 -lodbc32gt -latl -lwebhits -liscomlog -ldimsroam -lmqcertui -lgptext -lcfgbkend -lmsoe -latmlib -lcscapi -lfxscfgwz -lmciole32 -lportabledeviceguids -lhttpodbc -lcomsetup -ld3dx10_37 -lmprmsg -lconnect -liaspolcy -lfxsocm -lslcext -lnetoc -ld3dx10_38 -llonsint -lperfts -lfribidi -lwintrust -ladvapi32 -lmsvcrt-os -lfeclient -lcomsvcs -ld3dx9_27 -lazroles -lodbcbcp -lcnvfat -lwsock32 -lwininet -ld3d8thk -lhgfs -ld3dx9_38 -ldsauth -lakscoinst -ldnsapi -lmciwave -lcdm -lrpcref -lmofd -lsmtpapi -linetmib1 -ld3dcsxd -lrasmxs -lwebp -lunistring -ldmutil -lseclogon -lglibmm-2.4 -lesent -lt2embed -liprtprio -lrasrad -lolecnv32 -ld3dx9_37 -ldsquery -licaapi -liisrtl -ldbus-1 -lmqperf -lspoolss -lw3ctrs -lirclass -liyuv_32 -lwdstptc -lcliconfg -lufat -lsfc -lmsvcr120 -lmsw3prt -lntdsbcli -lhnetcfg -lxapofx1_3 -lwevtfwd -lx3daudio1_7 -lwinipsec -lmsafd -lmfsensorgroup -lhnetwiz -lcomres -lguitrn -lclb -lwow64 -lexstrace -lmsir3jp -lmciseq -lfxsapi -lntoc -lwinsrv -ldwrite -loccache -lodbc32 -loledb32 -lresutils -lcabview -lmsvcr120d -lwmilib -lusbd -liis -lmprddm -lrassapi -lsrchctls -lodbcconf -linfoadmn -lapcups -lmspatcha -lruntimeobject -lcomsnap -lsrclient -lmfcore -liprtrmgr -liisutil -lmscat32 -lasp -lks -limjpcus -lmsutb -lw3core -lxinput1_3 -licwphbk -linfosoft -lversion -lipmontr -laudiosrv -lbasesrv -lcsrsrv -lcolbact -lndisnpp -lpintlcsd -ld3dcompiler_41 -ld3dx9_33 -lpautoenr -ld3d9 -lsfmapi -lws2_32 -lmsvcp60 -lhidparse -lmingwex -lp2pcollab -ldinput8 -lalrsvc -lmsmqocm -lsfc_os -lpangowin32-1.0 -lmydocs -llog -ldpapi -lsti -lnwprovau -lw3isapi -lrasauto -lmciavi32 -lmsobdl -lumandlg -lhlink -lschannel -ldskquota -lsxs -lx3daudio1_4 -liesetup -lhal -lnetshell -lw32topl -lregapi -lmprapi -lz -lcmpbk32 -ld3dx9_31 -lmsoert2 -ltaskschd -lmfuuid -ltapi32 -lnddenb32 -lprntvpt -ldbgeng -lwbemcore -ligmpagnt -ldsprop -lnetcfgx -lslbcsp -lx3daudio1_3 -lmsacm32 -ldismapi -lhttpmib -lrpchttp -lpcre16 -lcomctl32 -lqwave -lbatmeter -lgetuname -lcairomm-1.0 -linitpki -lwbemuuid -lxinput -lmmutilse -lmsdtcprx -lssdpapi -lfdeploy -lmsimg32 -lwindowscodecs -latkctrs -liiswmi -lfaultrep -licwdial -lvirtdisk -lntoskrnl -lmqsec -lschedsvc -ladvpack -lrpcrt4 -loeimport -lscarddlg -ldinput -lwbemupgd -lvdsutil -les -lshimeng -lregsvc -lmfc42u -lscrnsave -lstorprop -lsigc-2.0 -linfoctrs -lnormaliz -lmcdsrv32 -lntlsapi -lcimwin32 -lucrt -ld3dcompiler_37 -lwow64win -ldnsrslvr -ldiskcopy -lws2help -lbthci -ldigest -lrtm -lrsaenh -lisatq -lxapofxd1_5 -lPS5UI -linetcfg -llz32 -ladsldpc -lxaudio2_8 -lmshtml -lserialui -lnetid -llmmib2 -lwdscsl -lntdll -ld3dcsx_46 -lqutil -ldxerr8 -leventlog -licfgnt5 -lglibmm_generate_extra_defs-2.4 -lmsdtclog -lupnpui -laqueue -licm32 -lmprui -lnetui2 -lfxsui -lucrtapp -lmsls31 -ldpnhupnp -lhid -lautodisc -lmapi32 -lwdsutil -lrnr20 -lm -lcompstui -lsysmod -lpcwum -lwmiprop -lntlanui -lgpedit -lwebpdemux -limgutil -lmfplat -loledlg -lclusapi -ld3dcompiler_40 -llocationapi -lw3ssl -ldelayimp -lmsdtctm -leappprxy -lstrmfilt -lmqdscli -lxinput1_4 -ldxerr9 -llprhelp -ltcpmib -loleaut32 -laspperf -lstrmiids -lzoneoc -lfwpuclnt -lwdmaud -lcards -lssh2 -ld3dx9_25 -lmssip32 -lwer -ldmoguids -lds32gt -ladsiisex -lurlauth -lnetlogon -lmqutil -lepoxy -lsecurity -lauthz -lmqrtdep -ld3d12 -liphlpapi -ladptif -lxinput1_1 -limjp81k -lbthprops -lseo -lole32 -lsens -ldsuiext -lmincore -lesentprf -lhtrn_jis -llocalspl -lpschdprf -ldevobj -lwiadss -lnddeapi -lmsvcr110 -ld3dx9_28 -lnntpapi -ladsiid -lPSCRIPT5 -ldssec -lvgx -lfxsst -lsyncui -lsdhcinst -lkerberos -ld3dcompiler -ld3dx11_43 -lscredir -lmstask -lcurl -ld3dx9_39 -ld3dcompiler_43 -lqmgr -lpng16 -lhidclass -lrastapi -lavicap32 -lwimgapi -lcryptxml -lmchgrcoi -lxinput1_2 -lmingwthrd -lmtxclu -lsmtpctrs -lhttpext -ld3dcompiler_39 -lduser -lmqise -limjpdct -lwmcodecdspuuid -lchtskdic -lfilemgmt -lUNIDRV -lperfctrs -lkd1394 -lwmi2xml -ldpvoice -lidn2 -lscrrun -lshlwapi -lmsyuv -lpsbase -lipnathlp -lcryptsp -lmcicda -lshcore -ld3dx9_41 -liscsidsc -ld3dx9_32 -lmqrt -lnetui1 -ld3dcompiler_35 -lwdsclientapi -lpolstore -lpe-parse -leappcfg -lw3dt -lrasser -ltbs -lx3daudio1_2 -lfltlib -lsisbkup -lstreamci -lmsvcr90d -llpk -ldcomp -lagentanm -lcfgmgr32 -lshdocvw -lwmi -lmqupgrd -lnetplwiz -lwow64mib -luniime -ldxguid -loemiglib -lwkssvc -lmsports -lverifier -lskdll -licmp -lquery -ld3dcompiler_47 -ldssenh -lintl -lsigtab -licwutil -lmsvcp120_app -lpidgen -lieakeng -lw3tp -lwinhvemulation -lmsrating -lutildll -lqosname -lslc -lframedyn -ldxgi -lwshatm -lroutetab -lolecli32 -lraschap -lkdcom -lcryptext -lnetrap -lcharset -lhostmib -lpropsys -lntdsapi -ld3dx9_36 -lcscui -lmsi -lx3daudiod1_7 -lresutil -lpthread -lamstrmid -llzma -lwinhvplatform -lmsdtcstp -lcertcli -lshell32 -ld3dcsxd_43 -lrdpwsx -lsensorsapi -lmqad -lipxsap -lmsdart -lhtui -lsvcpack -lwinrnr -lgthread-2.0 -lgdi32 -lcscdll -ldpnlobby -llargeint -ldsound3d -lshfolder -lmfreadwrite -lwinscard -ltsbyuv -lrasdlg -lsenscfg -lcatsrv -liconv -lmsv1_0 -lmsvcr80 -lksguid -lprofmap -lharfbuzz-subset -lwiashext -lxapofx1_2 -lsnmpmib -lwmiaprpl -lscript -lsrvsvc -lwinpthread -lp2p -lddraw -lmfplay -lcryptnet -lcomdlg32 -lmsgina -lncrypt -lipsecsvc -lrdpsnd -lurlmon -lndis -ljsproxy -lwabimp -levr -lffi -lsnmpapi -ld3dx10_39 -lconsole -lbatt -lwscapi -lpstorsvc -lfxswzrd -lgailutil-3 -ldmdskmgr -ldevmgr -lkernel32 -ljet500 -ldimsntfy -lwmisvc -lrasapi32 -lvcruntime140_app -lscrnsavw -lmsdtcuiu -ludhisapi -lntmsapi -lmcd32 -lntlanman -ld3dx10_42 -lmsvfw32 -lsti_ci -lnpptools -ld3dx9_34 -lfontsub -lolesvr32 -lfxst30 -lmscms -limagehlp -licwconn -lcryptui -lxapofx1_4 -lx3daudio1_5 -lbcrypt -lwlanutil -lwindowsapp -lhtmlhelp -ld3dx9_35 -lnewdev -lmsobmain -lunimdmat -ljasper -lcmdial32 -lshimgvw -lsamsrv -ld3dcompiler_34 -lndfapi -liisadmin -ltsappcmp -lmidimap -ldevrtl -lclbcatq -lslwga -lgpkcsp -ldxva2 -ld3d11 -ldhcpcsvc -lbz2 "
  --passL:"-L /home/jason/Downloads/gtk3.0-mingw/x86_64-w64-mingw32.static/lib/"
@can-lehmann
Copy link
Owner

I use Fedora myself and found cross compiling for Windows quite a pleasant experience. I do not currently have a Windows installation, so I could only test it using wine, but it seemed to work nicely (except for a few missing icons):

sudo dnf install mingw32-gtk3
sudo dnf install mingw64-gtk3
nim compile -d:mingw todo.nim 
sudo dnf install wine
WINEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ wine todo.exe 

Not having the mingw64-gtk3 package might complicate things somewhat (as you have described). As I do not use a debian based system, I don't think that I can be of much help here. I would however welcome a pull request adding a document describing how it can be done, should you get it to work. I do however think that dynamic linking is the way to go here, primarily for licensing reasons related to the LGPL.

In general GTK (and therefore owlkettle) might not be the best choice for Windows/Cross-Platform development anyway, since (as far as I know), GTK does not adapt its theme correctly to the operating system and therefore looks somewhat out of place. If you still really wanted to target Windows using owlkettle, a better option might be to create a second widgets.nim file which targets a different backend (instead of GTK). Large parts of owlkettle are not inherently GTK specific and could therefore theoretically be reused. This is of course a lot of work, and currently not one of my personal interests/priorities.

TLDR: Even though cross-compiling owlkettle apps to Windows is not one of my personal aims, if you find a way to get it to work properly, I would accept a pull request which adds a docs/cross_compiling.md describing the process for Ubuntu/Debian and Fedora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants