klogg icon indicating copy to clipboard operation
klogg copied to clipboard

Packaging Klogg for common (Linux distros') package manager repositories

Open jdnixx opened this issue 5 years ago • 11 comments

I couldn't find an answer to this, might've missed something that explains it - but is there a reason why Klogg isn't available directly through e.g. the Ubuntu/Debian repositories or other similar projects' repos?

As of recently I'm on NixOS, and of course there's nothing in the nix packages either but I've been wiping/reinstalling/switching between distros a ton recently and the first thing I find myself wishing when I get to the desktop in each one is to just crack open a shell and apt install klogg to view system logs instead of having to basically open the browser, navigate through github and manually grab the AppImage. I admit I'm not sure what's involved in the process of submitting new packages to the various repo's, as I've never done it so obviously understandable if it's not on the roadmap or whatever. (some quick googling: guides for the Debian archive and [probably more involved, likely best saved for a rainy day] nixpkgs list; also their github)

If it just hasn't been gotten around to yet and if needed, I might be able to help out with this, assuming I can keep up.

jdnixx avatar Sep 14 '20 04:09 jdnixx

No specific reason, just not enough experience in this area. Every once in a while I evaluate the idea, read debian/ubuntu packaging guides and get demotivated by amount of manual work involved. Right now the process of building all binary packages (rpm/deb/AppImage for Linux, dmg for MacOS, installers/portable version for Windows) is automated by means of Travis/Appveyor. As far as I know creating packages usually requires some distribution-specific tooling and environment. Running separate VMs for each distro to create packages and test installation is not an option. It might be possible to create docker containers and run packaging inside them using GitHub Workflow automation.

Any help with this matter is very welcome.

variar avatar Sep 14 '20 08:09 variar

I've updated readme with instructions on how to add deb/rpm repositories (hosted on Bintray).

variar avatar Sep 23 '20 08:09 variar

Just to update, I've been trying to work on packaging this in NixOS. As it turns out it sounds like it's actually pretty simple to do, potentially even easier than deb/rpm's. So I'm stumbling my way through it currently and might take a look at those after if I can possibly grok the process, but I know I personally want to have this in Nix for sure.

For anyone else who's interested, for future reference, or wants to clue me in on any pointers or gotchas, you basically just clone the nixOS/nixpkgs repo and create a directory for your new package within the tree; then set up a default.nix file in that. Making it even easier for klogg in particular, there's already a glogg package definition that I'm going off of... right now I'm just trying to figure out any differences in dependencies and how to create the definition minimally, without screwing something up; and making it syntactically modular so it'll maybe grab future updates automatically. Or at least requiring as little manual work as possible to maintain the package (it looks like the sha256 hash has to be hardcoded into the .nix file's src expression, so maybe impossible to have continuous builds with nix? not sure, their documentation is kind of a bear to deal with)

jdnixx avatar Sep 28 '20 18:09 jdnixx

@jDally987 that's some good news ) Let me know if you encounter any issues with building klogg. There is some documentation in BUILD.md.

Klogg and glogg build systems and dependencies are different. Glogg uses qmake and klogg is built using cmake.

Klogg provides almost all dependencies in 3rdparty folder and builds them from sources. Current external dependencies include Qt 5.9+ and curl for crash reports.

variar avatar Sep 29 '20 00:09 variar

@jDally987 Here is my package for NixOS (and any other Linux distro with nix) - https://github.com/sikmir/nur-packages/blob/master/pkgs/applications/misc/klogg/default.nix

sikmir avatar Oct 24 '20 20:10 sikmir

Thanks @sikmir! Lately I've added minidump_dump binary to 3rdparty/sentry/dump_syms/linux. Does it need to be added to patchelf command?

variar avatar Oct 27 '20 18:10 variar

Thanks @sikmir! Lately I've added minidump_dump binary to 3rdparty/sentry/dump_syms/linux. Does it need to be added to patchelf command?

Sure, fixed in https://github.com/sikmir/nur-packages/commit/3a250e0a7e434c00e387ed39922c5ea450d66564

Another question, I would like to use this nix package to install klogg on macOS as well, but I didn't managed to build sentry on macOS, it's a bit tricky and requires patching here and there. Is there any simple way to build klogg without sentry? It would be great to have such option, as far as sentry is not required for main functionality.

sikmir avatar Oct 27 '20 19:10 sikmir

@jDally987 Here is my package for NixOS (and any other Linux distro with nix) - https://github.com/sikmir/nur-packages/blob/master/pkgs/applications/misc/klogg/default.nix

Awesome, thanks I was definitely way in over my head when I tried doing this lol.

What all did you do to build it/add it to your system configuration? I tried first adding it under environment.systemPackages with (callPackage ./klogg/default.nix) and just added that klogg folder under /etc/nixos/, which almost seemed to work with such minimal effort, but it was complaining about cannot auto-call a function that has an argument without a default value ('stdenv').

Then I tried doing the "quick start to nixos packaging" method (cloning the nixpkgs tree, adding klogg folder under pkgs/tools/text/klogg, and adding the line with callPackages ... into pkgs/top-level/all-packages.nix), but when trying to build it with nix-build -A klogg it gives me: anonymous function at /home/jdnixx/nixpkgs/pkgs/tools/text/klogg/default.nix:1:1 called without required argument 'sources', at /home/jdnixx/nixpkgs/lib/customisation.nix:69:16.

I guess I'll leave it to you to submit to nixpkgs and everything, I was just trying to see if I could make it work locally, but I guess I'm still understanding something wrong with how things are supposed to be structured.

jdnixx avatar Oct 27 '20 21:10 jdnixx

@jDally987 In order to use my package, just follow NUR installation, then you can refer to it via nur.repos.sikmir.klogg.

sikmir avatar Oct 27 '20 21:10 sikmir

Another error with macOS build using nix:

FAILED: output/liblogdata.a
: && /nix/store/z7qvx6wbvmjvs767g06h03pkzr5aqn6i-cmake-3.18.2/bin/cmake -E rm -f output/liblogdata.a && "CMAKE_CXX_COMPILER_AR-NOTFOUND" cr output/liblogdata.a  src/logdata/CMakeFiles/logdata.dir/logdata_autogen/mocs_compilation.cpp.o src/logdata/CMakeFiles/logdata.dir/src/abstractlogdata.cpp.o src/logdata/CMakeFiles/logdata.dir/src/blockpool.cpp.o src/logdata/CMakeFiles/logdata.dir/src/compressedlinestorage.cpp.o src/logdata/CMakeFiles/logdata.dir/src/encodingdetector.cpp.o src/logdata/CMakeFiles/logdata.dir/src/logdata.cpp.o src/logdata/CMakeFiles/logdata.dir/src/logdataworker.cpp.o src/logdata/CMakeFiles/logdata.dir/src/logfiltereddata.cpp.o src/logdata/CMakeFiles/logdata.dir/src/logfiltereddataworker.cpp.o src/logdata/CMakeFiles/logdata.dir/src/marks.cpp.o src/logdata/CMakeFiles/logdata.dir/src/fileholder.cpp.o src/logdata/CMakeFiles/logdata.dir/src/filedigest.cpp.o && "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND" output/liblogdata.a && /nix/store/z7qvx6wbvmjvs767g06h03pkzr5aqn6i-cmake-3.18.2/bin/cmake -E touch output/liblogdata.a && :
/bin/sh: CMAKE_CXX_COMPILER_AR-NOTFOUND: command not found

ar is available in the PATH, but cmake can't find it. I've already tried to pass -DCMAKE_CXX_COMPILER_AR=<full-path-to-ar>, but it doesn't help.

sikmir avatar Nov 11 '20 22:11 sikmir

Note for self: consider merging nix packaging from @firestack fork

variar avatar Aug 06 '21 07:08 variar