From b4c1cf5e3671e8fee1a55a1cc1f0258152e62a4f Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Wed, 9 Feb 2022 19:21:52 -0300 Subject: [PATCH 1/2] gnucash: refactor Also add myself as maintainer. --- pkgs/applications/office/gnucash/default.nix | 75 +++++++++++++------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix index d6e5c4143a4a..a9d532a27c24 100644 --- a/pkgs/applications/office/gnucash/default.nix +++ b/pkgs/applications/office/gnucash/default.nix @@ -1,9 +1,10 @@ -{ fetchurl -, lib +{ lib , stdenv +, fetchurl , aqbanking , boost , cmake +, gettext , glib , glibcLocales , gtest @@ -16,7 +17,6 @@ , libxml2 , libxslt , makeWrapper -, perl , perlPackages , pkg-config , swig @@ -28,13 +28,15 @@ stdenv.mkDerivation rec { pname = "gnucash"; version = "4.9"; + # raw source code doesn't work out of box; fetchFromGitHub not usable src = fetchurl { - url = "https://github.com/Gnucash/gnucash/releases/download/${version}/gnucash-${version}.tar.bz2"; - sha256 = "0bdpzb0wc9bjph5iff7133ppnkcqzfd10yi2qagij4mpq4q1qmcs"; + url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2"; + hash = "sha256-mlUcMMG3EhmfwiJ6EJr7mE177xjhOBcLvHIlxsH6ty0="; }; nativeBuildInputs = [ cmake + gettext makeWrapper wrapGAppsHook ]; @@ -53,11 +55,15 @@ stdenv.mkDerivation rec { libofx libxml2 libxslt - perl pkg-config swig webkitgtk - ] ++ (with perlPackages; [ FinanceQuote DateManip ]); + ] + ++ (with perlPackages; [ + DateManip + FinanceQuote + perl + ]); patches = [ # this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges @@ -68,16 +74,14 @@ stdenv.mkDerivation rec { ./0003-remove-valgrind.patch ]; - preConfigure = '' - export GUILE_AUTO_COMPILE=0 # this needs to be an env variable and not a cmake flag to suppress guile warning - ''; + # this needs to be an environment variable and not a cmake flag to suppress + # guile warning + GUILE_AUTO_COMPILE="0"; + # `make check` target does not define its prerequisites but expects them to + # have already been built. The list of targets below was built through trial + # and error based on failing tests. doCheck = true; - - /* - GNUcash's `make check` target does not define its prerequisites but expects them to have already been built. - The list of targets below was built through trial and error based on failing tests. - */ preCheck = '' make \ test-account-object \ @@ -156,12 +160,15 @@ stdenv.mkDerivation rec { preFixup = '' gappsWrapperArgs+=( - --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd # specify where db drivers are - --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"} # specify where nix puts the gnome settings schemas + # db drivers location + --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd + # gnome settings schemas location on Nix + --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"} ) ''; - # wrapGAppsHook would wrap all binaries including the cli utils which need Perl wrapping + # wrapGAppsHook would wrap all binaries including the cli utils which need + # Perl wrapping dontWrapGApps = true; # gnucash is wrapped using the args constructed for wrapGAppsHook. @@ -176,15 +183,31 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - description = "Personal and small business double entry accounting application."; - longDescription = '' - Designed to be easy to use, yet powerful and flexible, GnuCash allows you to track bank accounts, stocks, income and expenses. - As quick and intuitive to use as a checkbook register, it is based on professional accounting principles to ensure balanced books and accurate reports. - ''; - homepage = "https://www.gnucash.org/"; + description = "Free software for double entry accounting"; + longDescription = '' + GnuCash is personal and small-business financial-accounting software, + freely licensed under the GNU GPL and available for GNU/Linux, BSD, + Solaris, Mac OS X and Microsoft Windows. + + Designed to be easy to use, yet powerful and flexible, GnuCash allows you + to track bank accounts, stocks, income and expenses. As quick and + intuitive to use as a checkbook register, it is based on professional + accounting principles to ensure balanced books and accurate reports. + + Some interesting features: + + - Double-Entry Accounting + - Stock/Bond/Mutual Fund Accounts + - Small-Business Accounting + - Reports, Graphs + - QIF/OFX/HBCI Import, Transaction Matching + - Scheduled Transactions + - Financial Calculations + ''; license = licenses.gpl2Plus; - maintainers = [ maintainers.domenkozar ]; - platforms = platforms.linux; + maintainers = with maintainers; [ domenkozar AndersonTorres ]; + platforms = platforms.unix; }; } +# TODO: investigate Darwin support From 038338b1dde47a086b2498dbf30416681e45bf3b Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Thu, 10 Feb 2022 00:24:43 -0300 Subject: [PATCH 2/2] dosbox-staging: 0.77.1 -> 0.78.1 --- .../misc/emulators/dosbox-staging/default.nix | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/pkgs/misc/emulators/dosbox-staging/default.nix b/pkgs/misc/emulators/dosbox-staging/default.nix index 05c970507b2a..438849e7fd8a 100644 --- a/pkgs/misc/emulators/dosbox-staging/default.nix +++ b/pkgs/misc/emulators/dosbox-staging/default.nix @@ -4,32 +4,40 @@ , SDL2 , SDL2_net , alsa-lib +, copyDesktopItems , fluidsynth , gtest , libGL , libGLU , libogg , libpng +, libslirp +, makeDesktopItem , makeWrapper , meson , libmt32emu , ninja , opusfile , pkg-config +, libpulseaudio +, glib +, libjack2 +, libsndfile }: stdenv.mkDerivation rec { pname = "dosbox-staging"; - version = "0.77.1"; + version = "0.78.1"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "07jwmmm1bhfxavlhl854cj8l5iy5hqx5hpwkkjbcwqg7yh9jfs2x"; + hash = "sha256-gozFZcJorZtbEK0joksig6qWmAMy03hmBHiyJMONfpk="; }; nativeBuildInputs = [ + copyDesktopItems gtest makeWrapper meson @@ -42,42 +50,63 @@ stdenv.mkDerivation rec { SDL2_net alsa-lib fluidsynth + glib libGL libGLU + libjack2 libmt32emu libogg libpng + libpulseaudio + libslirp + libsndfile opusfile ]; - hardeningDisable = [ "format" ]; + NIX_CFLAGS_COMPILE = [ + "-I${SDL2_net}/include/SDL2" + ]; - mesonFlags = [ - "--buildtype=release" - "-Db_asneeded=true" - "-Ddefault_library=static" - "-Dfluidsynth:enable-floats=true" - "-Dfluidsynth:try-static-deps=true" - "-Dtry_static_libs=png" + desktopItems = [ + (makeDesktopItem { + name = "dosbox-staging"; + exec = "dosbox-staging"; + icon = "dosbox-staging"; + comment = "x86 dos emulator enhanced"; + desktopName = "DosBox-Staging"; + genericName = "DOS emulator"; + categories = "Emulator;Game;"; + }) ]; postFixup = '' # Rename binary, add a wrapper, and copy manual to avoid conflict with - # vanilla dosbox. Doing it this way allows us to work with frontends and + # original dosbox. Doing it this way allows us to work with frontends and # launchers that expect the binary to be named dosbox, but get out of the # way of vanilla dosbox if the user desires to install that as well. - mv $out/bin/dosbox $out/bin/${pname} makeWrapper $out/bin/dosbox-staging $out/bin/dosbox - cp $out/share/man/man1/dosbox.1.gz $out/share/man/man1/${pname}.1.gz + + # Create a symlink to dosbox manual instead of merely copying it + pushd $out/share/man/man1/ + mv dosbox.1.gz ${pname}.1.gz + ln -s ${pname}.1.gz dosbox.1.gz + popd ''; meta = with lib; { homepage = "https://dosbox-staging.github.io/"; description = "A modernized DOS emulator"; + longDescription = '' + DOSBox Staging is an attempt to revitalize DOSBox's development + process. It's not a rewrite, but a continuation and improvement on the + existing DOSBox codebase while leveraging modern development tools and + practices. + ''; license = licenses.gpl2Plus; - maintainers = with maintainers; [ joshuafern ]; + maintainers = with maintainers; [ joshuafern AndersonTorres ]; platforms = platforms.unix; priority = 101; }; } +# TODO: report upstream about not finding SDL2_net