From 31a416967a3a9765023d3bcdab14c72f4e79d32d Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Tue, 13 Jun 2023 00:39:57 -0600 Subject: pkgs/oregano: prepare for upstream --- pkgs/oregano/check-cfg-gio-unix.patch | 12 ++++++++++++ pkgs/oregano/default.nix | 37 ++++++++++++++++++++++++++++------- pkgs/oregano/gio-unix.patch | 12 ------------ 3 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 pkgs/oregano/check-cfg-gio-unix.patch delete mode 100644 pkgs/oregano/gio-unix.patch diff --git a/pkgs/oregano/check-cfg-gio-unix.patch b/pkgs/oregano/check-cfg-gio-unix.patch new file mode 100644 index 0000000..a20bf0d --- /dev/null +++ b/pkgs/oregano/check-cfg-gio-unix.patch @@ -0,0 +1,12 @@ +diff --git a/wscript b/wscript +index 03de4b3..f64ccc4 100644 +--- a/wscript ++++ b/wscript +@@ -68,6 +68,7 @@ def configure(conf): + + conf.check_cfg(atleast_pkgconfig_version='0.26') + conf.check_cfg(package='glib-2.0', uselib_store='GLIB', args=['glib-2.0 >= 2.44', '--cflags', '--libs'], mandatory=True) ++ conf.check_cfg(package='gio-unix-2.0', uselib_store='GLIB', args=['--cflags', '--libs'], mandatory=True) + conf.check_cfg(package='gobject-2.0', uselib_store='GOBJECT', args=['--cflags', '--libs'], mandatory=True) + conf.check_cfg(package='gtk+-3.0', uselib_store='GTK3', args=['gtk+-3.0 >= 3.12', '--cflags', '--libs'], mandatory=True) + conf.check_cfg(package='libxml-2.0', uselib_store='XML', args=['--cflags', '--libs'], mandatory=True) diff --git a/pkgs/oregano/default.nix b/pkgs/oregano/default.nix index 82303f4..5e2e872 100644 --- a/pkgs/oregano/default.nix +++ b/pkgs/oregano/default.nix @@ -1,18 +1,22 @@ -{ lib -, fetchFromGitHub +{ fetchFromGitHub , glib , goocanvas2 +, gnucap , groff , gtk3 , gtksourceview , intltool , libxml2 +, lib +, makeWrapper +, ngspice , perl , pkg-config -, python +, python3 , stdenv , wafHook , wrapGAppsHook +, useNgspice ? false }: let version = "0.84.43"; @@ -28,19 +32,38 @@ stdenv.mkDerivation { hash = "sha256-1GsL0N3O0clqdgkXoPKMhvW+y4Rzg4QSeOA54nH4kz4="; }; - nativeBuildInputs = [ wafHook wrapGAppsHook ]; - patches = [ ./gio-unix.patch ]; + nativeBuildInputs = [ makeWrapper wafHook wrapGAppsHook ]; + patches = [ ./check-cfg-gio-unix.patch ]; buildInputs = [ - intltool glib goocanvas2 groff gtk3 gtksourceview + intltool libxml2 perl pkg-config - python + python3 ]; + + postFixup = '' + wrapProgram $out/bin/oregano \ + --suffix PATH : ${lib.makeBinPath [ (if useNgspice then ngspice else gnucap) ]} + ''; + + meta = with lib; { + description = "Schematic capture and circuit simulator"; + longDescription = '' + Oregano is an application for schematic capture and simulation of + electronic circuits. The actual simulation is performed by Berkeley + Spice, GNUcap or the new generation ngspice. + ''; + + homepage = "https://github.com/drahnr/oregano/"; + license = licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with maintainers; [ _3442 ]; + }; } diff --git a/pkgs/oregano/gio-unix.patch b/pkgs/oregano/gio-unix.patch deleted file mode 100644 index a20bf0d..0000000 --- a/pkgs/oregano/gio-unix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/wscript b/wscript -index 03de4b3..f64ccc4 100644 ---- a/wscript -+++ b/wscript -@@ -68,6 +68,7 @@ def configure(conf): - - conf.check_cfg(atleast_pkgconfig_version='0.26') - conf.check_cfg(package='glib-2.0', uselib_store='GLIB', args=['glib-2.0 >= 2.44', '--cflags', '--libs'], mandatory=True) -+ conf.check_cfg(package='gio-unix-2.0', uselib_store='GLIB', args=['--cflags', '--libs'], mandatory=True) - conf.check_cfg(package='gobject-2.0', uselib_store='GOBJECT', args=['--cflags', '--libs'], mandatory=True) - conf.check_cfg(package='gtk+-3.0', uselib_store='GTK3', args=['gtk+-3.0 >= 3.12', '--cflags', '--libs'], mandatory=True) - conf.check_cfg(package='libxml-2.0', uselib_store='XML', args=['--cflags', '--libs'], mandatory=True) -- cgit v1.2.3