about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/wxsqliteplus
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/wxsqliteplus')
-rw-r--r--nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
new file mode 100644
index 000000000000..fecd61bb6e51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite, Cocoa, setfile }:
+
+stdenv.mkDerivation rec {
+  pname = "wxsqliteplus";
+  version = "0.3.6";
+
+  src = fetchFromGitHub {
+    owner = "guanlisheng";
+    repo = "wxsqliteplus";
+    rev = "v${version}";
+    sha256 = "0mgfq813pli56mar7pdxlhwjf5k10j196rs3jd0nc8b6dkzkzlnf";
+  };
+
+  buildInputs = [ wxGTK wxsqlite3 sqlite ] ++ lib.optional stdenv.isDarwin Cocoa;
+
+  makeFlags = [
+    "LDFLAGS=-L${wxsqlite3}/lib"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "SETFILE=${setfile}/bin/SetFile"
+  ];
+
+  preBuild = ''
+    sed -ie 's|all: $(LIBPREFIX)wxsqlite$(LIBEXT)|all: |g' Makefile
+    sed -ie 's|wxsqliteplus$(EXEEXT): $(WXSQLITEPLUS_OBJECTS) $(LIBPREFIX)wxsqlite$(LIBEXT)|wxsqliteplus$(EXEEXT):  $(WXSQLITEPLUS_OBJECTS) |g' Makefile
+    sed -ie 's|-lwxsqlite |-lwxcode_${if stdenv.isDarwin then "osx_cocoau_wxsqlite3-3.0.0" else "gtk2u_wxsqlite3-3.0"} |g' Makefile
+  '';
+
+  installPhase = ''
+    install -D ${lib.optionalString stdenv.isDarwin "wxsqliteplus.app/Contents/MacOS/"}wxsqliteplus $out/bin/wxsqliteplus
+  '' + lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    mv wxsqliteplus.app $out/Applications/
+  '';
+
+  meta = with lib; {
+    description = "A simple SQLite database browser built with wxWidgets";
+    homepage = "https://github.com/guanlisheng/wxsqliteplus";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.unix;
+  };
+}