diff --git a/pkgs/by-name/to/tomboy-ng/package.nix b/pkgs/by-name/to/tomboy-ng/package.nix new file mode 100644 index 000000000000..4341d4ac8325 --- /dev/null +++ b/pkgs/by-name/to/tomboy-ng/package.nix @@ -0,0 +1,82 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fpc, + lazarus, + autoPatchelfHook, + + glib, + cairo, + pango, + gtk2, + gdk-pixbuf, + at-spi2-atk, + xorg, + libnotify, + + nix-update-script, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "tomboy-ng"; + version = "0.40"; + + src = fetchFromGitHub { + owner = "tomboy-notes"; + repo = "tomboy-ng"; + rev = "v${finalAttrs.version}"; + hash = "sha256-QRv0LVZpRxW9c/cCcDsMSAYQ3zuYa39VJbcys5N+1x0="; + }; + kcontrols = fetchFromGitHub { + owner = "davidbannon"; + repo = "KControls"; + rev = "4b74f50599544aa05d76385c21795ca9026e9657"; + hash = "sha256-AHpcbt5v9Y/YG9MZ/zCLLH1Pfryv0zH8UFCgY/RqrdQ="; + name = "kcontrols"; + }; + + nativeBuildInputs = [ + fpc + lazarus + autoPatchelfHook + ]; + + buildInputs = [ + glib + cairo + pango + gtk2 + gdk-pixbuf + at-spi2-atk + xorg.libX11 + libnotify + ]; + + patches = [ ./simplify-build-script.patch ]; + + postPatch = "ln -s ${finalAttrs.kcontrols} kcontrols"; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + passthru.updateScript = nix-update-script { + # Stable releases only + extraArgs = [ + "--version-regex" + "^v([0-9.]+)$" + ]; + }; + + env = { + COMPILER = lib.getExe' fpc "fpc"; + LAZ_DIR = "${lazarus}/share/lazarus"; + }; + + meta = { + description = "Note taking app that works and synchronises between Linux, Windows and macOS"; + homepage = "https://github.com/tomboy-notes/tomboy-ng"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ pluiedev ]; + mainProgram = "tomboy-ng"; + platforms = lib.platforms.unix ++ lib.platforms.windows; + }; +}) diff --git a/pkgs/by-name/to/tomboy-ng/simplify-build-script.patch b/pkgs/by-name/to/tomboy-ng/simplify-build-script.patch new file mode 100644 index 000000000000..d2b08ca2a080 --- /dev/null +++ b/pkgs/by-name/to/tomboy-ng/simplify-build-script.patch @@ -0,0 +1,79 @@ +diff --git a/buildit.bash b/buildit.bash +index 6606562..57b9e14 100755 +--- a/buildit.bash ++++ b/buildit.bash +@@ -61,7 +61,7 @@ EXCLUDEMESSAGE=" -vm6058,2005,5027 " # cut down on compiler noise + # 6058 - note about things not being inlined + # 5027 - var not used + # 2005 - level 2 comment +-FPCHARD=" -Cg -k-pie -k-znow " ++FPCHARD="" + AUTODOWNLOAD=FALSE # downloading large file, use -d to allow it + + # ------------------------ Some functions ------------------------ +@@ -180,8 +180,6 @@ if [ "$CPU" = "powerpc64le" ]; then # power does not like intel switches ! + fi + + TARGET="$CPU-$OS" +-CheckFPC +-CheckLazBuild + CheckForQt5 + + # OK, if to here, we have a fpc and lazbuild, but which FPC ? +@@ -228,8 +226,8 @@ cd "$K_DIR" # WARNING, kcontrols is not part of the github zip file, its added + + # Here we build just the kmemo.pas part of kcontrols. + +-mkdir -p "lib/$TARGET" # this is where kcontrols object files end up. +-rm -f "lib/$CPU-$OS/kmemo.o" # make sure we try to build a new one, but probably not there. ++OUTPUT=$(mktemp -d) ++mkdir -p "$OUTPUT/lib/$TARGET" + + FPCKOPT=" -B -MObjFPC -Scgi -Cg -O1 -g -gl -l -vewnibq -vh- $EXCLUDEMESSAGES -Fi$K_DIR" + FPCKUNITS=" -Fu$LAZ_DIR/packager/units/$TARGET -Fu$LAZ_DIR/components/lazutils/lib/$TARGET" +@@ -237,7 +235,7 @@ FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/components/buildintf/units/$TARGET -Fu$LAZ_DIR + FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/lib/$TARGET -Fu$LAZ_DIR/lcl/units/$TARGET -Fu$LAZ_DIR/lcl/units/$TARGET/$WIDGET" + FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/components/cairocanvas/lib/$TARGET/$WIDGET -Fu$LAZ_DIR/components/lazcontrols/lib/$TARGET/$WIDGET" + FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/components/ideintf/units/$TARGET/$WIDGET -Fu$LAZ_DIR/components/printers/lib/$TARGET/$WIDGET" +-FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/components/tdbf/lib/$TARGET/$WIDGET -Fu. -FUlib/$TARGET" ++FPCKUNITS="$FPCKUNITS -Fu$LAZ_DIR/components/tdbf/lib/$TARGET/$WIDGET -Fu. -FU$OUTPUT/lib/$TARGET" + + RUNIT="$COMPILER $EXCLUDEMESSAGE $FPCKOPT $FPCHARD $LAZUNITSRC $FPCKUNITS kmemo.pas" + +@@ -245,12 +243,12 @@ echo "--------------- kcontrols COMPILE COMMAND -------------" + echo "$RUNIT" + echo "-----------------" + +-$RUNIT 1>tomboy-ng.log ++$RUNIT + + # exit + + +-if [ ! -e "$K_DIR/lib/$CPU-$OS/kmemo.o" ]; then ++if [ ! -e "$OUTPUT/lib/$CPU-$OS/kmemo.o" ]; then + echo "ERROR failed to build KControls, exiting..." + K_DIR="" + exit 1 +@@ -301,7 +299,7 @@ UNITS="$UNITS -Fu$LAZ_DIR/lcl/units/$TARGET" + UNITS="$UNITS -Fu$LAZ_DIR/packager/units/$TARGET" + + UNITS="$UNITS -Fu$SOURCE_DIR/" +-UNITS="$UNITS -FU$SOURCE_DIR/lib/$TARGET/" ++UNITS="$UNITS -FU$OUTPUT/lib/$TARGET/" + + OPT2=" -dLCL -dLCL$WIDGET" + DEFS="-dDisableLCLGIF -dDisableLCLJPEG -dDisableLCLPNM -dDisableLCLTIFF" +@@ -322,11 +320,10 @@ RUNIT="$COMPILER $OPT1 $FPCHARD $UNITS $LAZUNITSRC $OPT2 $DEFS $PROJ.lpr" + echo "------------ tomboy-ng COMPILE COMMAND --------------------" + echo "$RUNIT" + +-TOMBOY_NG_VER="$VERSION" $RUNIT 1>>tomboy-ng.log ++TOMBOY_NG_VER="$VERSION" $RUNIT + + if [ ! -e "$PROJ" ]; then + echo "======================== ERROR, COMPILE FAILED source/tomboy-ng.log =====" +- cat tomboy-ng.log + echo "=========================================================== END of LOG ==" + exit 1 + else