1 { lib, stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite, Cocoa, setfile }:
3 stdenv.mkDerivation rec {
4 pname = "wxsqliteplus";
7 src = fetchFromGitHub {
11 sha256 = "0mgfq813pli56mar7pdxlhwjf5k10j196rs3jd0nc8b6dkzkzlnf";
15 sed -i '/WX_CLEAR_ARRAY/s/$/;/' src/{createtable,sqlite3table}.cpp
18 buildInputs = [ wxGTK wxsqlite3 sqlite ] ++ lib.optional stdenv.isDarwin Cocoa;
21 "LDFLAGS=-L${wxsqlite3}/lib"
22 ] ++ lib.optionals stdenv.isDarwin [
23 "SETFILE=${setfile}/bin/SetFile"
27 sed -ie 's|all: $(LIBPREFIX)wxsqlite$(LIBEXT)|all: |g' Makefile
28 sed -ie 's|wxsqliteplus$(EXEEXT): $(WXSQLITEPLUS_OBJECTS) $(LIBPREFIX)wxsqlite$(LIBEXT)|wxsqliteplus$(EXEEXT): $(WXSQLITEPLUS_OBJECTS) |g' Makefile
29 sed -ie 's|-lwxsqlite |-lwxcode_${if stdenv.isDarwin then "osx_cocoau_wxsqlite3-3.2.0" else "gtk3u_wxsqlite3-3.2"} |g' Makefile
33 install -D ${lib.optionalString stdenv.isDarwin "wxsqliteplus.app/Contents/MacOS/"}wxsqliteplus $out/bin/wxsqliteplus
34 '' + lib.optionalString stdenv.isDarwin ''
35 mkdir -p $out/Applications
36 mv wxsqliteplus.app $out/Applications/
40 description = "A simple SQLite database browser built with wxWidgets";
41 homepage = "https://github.com/guanlisheng/wxsqliteplus";
42 license = licenses.gpl3Plus;
43 maintainers = [ maintainers.vrthra ];
44 platforms = platforms.unix;