nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.5 KiB
Nix
Raw Normal View History

2022-06-16 17:32:07 +00:00
{ lib, stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite, Cocoa, setfile }:
2016-07-05 20:14:58 +00:00
stdenv.mkDerivation rec {
pname = "wxsqliteplus";
2016-07-05 20:14:58 +00:00
version = "0.3.6";
src = fetchFromGitHub {
owner = "guanlisheng";
repo = "wxsqliteplus";
rev = "v${version}";
sha256 = "0mgfq813pli56mar7pdxlhwjf5k10j196rs3jd0nc8b6dkzkzlnf";
2016-07-05 20:14:58 +00:00
};
2022-10-28 15:13:02 +00:00
postPatch = ''
sed -i '/WX_CLEAR_ARRAY/s/$/;/' src/{createtable,sqlite3table}.cpp
'';
2022-06-16 17:32:07 +00:00
buildInputs = [ wxGTK wxsqlite3 sqlite ] ++ lib.optional stdenv.isDarwin Cocoa;
2016-07-05 20:14:58 +00:00
makeFlags = [
"LDFLAGS=-L${wxsqlite3}/lib"
2022-06-16 17:32:07 +00:00
] ++ lib.optionals stdenv.isDarwin [
"SETFILE=${setfile}/bin/SetFile"
2016-07-05 20:14:58 +00:00
];
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
2022-10-28 15:13:02 +00:00
sed -ie 's|-lwxsqlite |-lwxcode_${if stdenv.isDarwin then "osx_cocoau_wxsqlite3-3.2.0" else "gtk3u_wxsqlite3-3.2"} |g' Makefile
2016-07-05 20:14:58 +00:00
'';
installPhase = ''
2022-06-16 17:32:07 +00:00
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/
2016-07-05 20:14:58 +00:00
'';
meta = with lib; {
2016-07-05 20:14:58 +00:00
description = "A simple SQLite database browser built with wxWidgets";
2022-06-16 17:32:07 +00:00
homepage = "https://github.com/guanlisheng/wxsqliteplus";
2022-10-28 15:13:02 +00:00
license = licenses.gpl3Plus;
2022-06-16 17:32:07 +00:00
maintainers = [ maintainers.vrthra ];
platforms = platforms.unix;
2016-07-05 20:14:58 +00:00
};
}