{"id":371,"date":"2019-07-20T16:49:48","date_gmt":"2019-07-20T14:49:48","guid":{"rendered":"https:\/\/netbsd.name\/?p=371"},"modified":"2019-08-03T14:57:47","modified_gmt":"2019-08-03T12:57:47","slug":"codelite-building-issues-from-pkgsrc","status":"publish","type":"post","link":"https:\/\/netbsd.name\/?p=371","title":{"rendered":"Codelite building issues from pkgsrc"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Recently I am trying to build my own desktop environment on NetBSD which is based on current branch and using current <a rel=\"noreferrer noopener\" aria-label=\"pkgsrc (opens in a new tab)\" href=\"https:\/\/www.pkgsrc.org\" target=\"_blank\">pkgsrc<\/a> for packages.  I successfully built up to date <a href=\"https:\/\/mate-desktop.org\/\">MATE<\/a> 1.22.1 desktop environment but got stuck on pretty outaded <a href=\"https:\/\/codelite.org\/\">CodeLite<\/a> IDE (9.1.0 in pkgsrc compared to 13.0.0 being the latest at the time of writing). The first error I hit by was:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/usr\/pkgsrc\/editors\/codelite\/work\/codelite-9.1\/LiteEditor\/clangpch_cache.h:35:10: fatal error: clang-c\/Index.h: No such file or directory<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since I was quite sure that I should have it, I quickly looked around and I found that header exists in \/usr\/pkg\/include\/clang-c\/Index.h. So quick workaround was quite obvious by setting CFLAGS environment variable to point to pkg include folder. Since I checked that this variable didn&#8217;t have any value, I just simply did:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>export CFLAGS=\/usr\/pkg\/include<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It helped me to finish the build successfully but linking failed with &#8220;ld: cannot find -lclang&#8221; error&#8230; So yet another environment variable was needed:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>export LIBRARY_PATH=\/usr\/pkg\/lib<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that linking went successfully but it wasn&#8217;t the end of the story yet. Package PLIST file contained 5 files which were not available after the build. Apparently spell checker was not part of the build for some reason and lib\/codelite\/SpellCheck.so and all files in share\/codelite\/dics\/ folder (including folder itself) were missing. Because of this pkg_create was failing to assemble the installation package. You would see messages like &#8220;pkg_create: can&#8217;t stat &lt;filename&gt;&#8221;. I just decided remove those files from PLIST file:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"collapseomatic \" id=\"id6adb596330de2\"  tabindex=\"0\" title=\"fossil diff --unified PLIST\"    >fossil diff --unified PLIST<\/span><div id=\"target-id6adb596330de2\" class=\"collapseomatic_content \"><br>Index: editors\/codelite\/PLIST<br>==================================================================<br>&#8212; editors\/codelite\/PLIST<br> +++ editors\/codelite\/PLIST<br> @@ -22,11 +22,10 @@<br>  lib\/codelite\/MemCheck.so<br>  lib\/codelite\/Outline.so<br>  lib\/codelite\/QMakePlugin.so<br>  lib\/codelite\/SFTP.so<br>  lib\/codelite\/SnipWiz.so<br> -lib\/codelite\/SpellCheck.so<br>  lib\/codelite\/Subversion.so<br>  lib\/codelite\/Tweaks.so<br>  lib\/codelite\/UnitTestsPP.so<br>  lib\/codelite\/WebTools.so<br>  lib\/codelite\/Wizards.so<br> @@ -64,14 +63,10 @@<br>  share\/codelite\/config\/cfg\/sdl.cfg<br>  share\/codelite\/config\/cfg\/std.cfg<br>  share\/codelite\/config\/cfg\/windows.cfg<br>  share\/codelite\/config\/codelite.xml.default<br>  share\/codelite\/config\/debuggers.xml.default<br> -share\/codelite\/dics\/en_GB.aff<br> -share\/codelite\/dics\/en_GB.dic<br> -share\/codelite\/dics\/en_US.aff<br> -share\/codelite\/dics\/en_US.dic<br>  share\/codelite\/gdb_printers\/boost\/<strong>init<\/strong>.py<br>  share\/codelite\/gdb_printers\/boost\/printers.py<br>  share\/codelite\/gdb_printers\/helper.py<br>  share\/codelite\/gdb_printers\/libstdcxx\/<strong>init<\/strong>.py<br>  share\/codelite\/gdb_printers\/libstdcxx\/v6\/<strong>init<\/strong>.py<br><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Unfortunately there is one caveat that after changing this file I needed to make a clean build again (make clean before make install). Fortunately, it doesn&#8217;t take long to rebuild CodeLite on modern CPU, especially if all cores are utilized. Finally, after all the struggles CodeLite IDE started successfully (even if it&#8217;s a relatively old version). <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelight-1024x527.jpg\" alt=\"\" class=\"wp-image-373\" srcset=\"https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelight-1024x527.jpg 1024w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelight-300x154.jpg 300w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelight-768x395.jpg 768w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelight.jpg 1919w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>CodeLite 9.1.0 on NetBSD amd64 8.99.50<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Update:<\/strong> Actually I managed to build the latest CodeLite (13.0.1) too straight from <a rel=\"noreferrer noopener\" aria-label=\"github (opens in a new tab)\" href=\"https:\/\/github.com\/eranif\/codelite\" target=\"_blank\">github<\/a> source code.  The most applied patches were the same as pkgsrc package has (actually seems even less is needed now). Manually I needed to add \/usr\/pkg\/libexec\/wx-3.0 to PATH since build script need wx-config and I also needed to change libssh.so path to from \/usr\/lib\/libssh.so to \/usr\/pkg\/lib\/libssh.so (libssh-0.87) in CMakeFiles\/&lt;module&gt;.dir\/link.txt files which were linking against it. Probably updating pkgsrc package should not be difficult too considering my relatively easy success ,  so I guess package is not actively maintained anymore. Will see if I can prepare a patch.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" src=\"https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelite13.0.1-1024x524.png\" alt=\"\" class=\"wp-image-379\" srcset=\"https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelite13.0.1-1024x524.png 1024w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelite13.0.1-300x154.png 300w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelite13.0.1-768x393.png 768w, https:\/\/netbsd.name\/wp-content\/uploads\/2019\/07\/codelite13.0.1.png 1919w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>CodeLite 13.0.1 on NetBSD amd64 8.99.50<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Recently I am trying to build my own desktop environment on NetBSD which is based on current branch and using current pkgsrc for packages. I successfully built up to date MATE 1.22.1 desktop environment but got stuck on pretty outaded CodeLite IDE (9.1.0 in pkgsrc compared to 13.0.0 being the latest at the time of &hellip; <a href=\"https:\/\/netbsd.name\/?p=371\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Codelite building issues from pkgsrc<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,18],"tags":[],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-netbsd","category-pkgsrc"],"_links":{"self":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371"}],"version-history":[{"count":7,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions\/386"}],"wp:attachment":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}