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.hostPlatform.isDarwin Cocoa;
21 "LDFLAGS=-L${wxsqlite3}/lib"
22 ] ++ lib.optionals stdenv.hostPlatform.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.hostPlatform.isDarwin then "osx_cocoau_wxsqlite3-3.2.0" else "gtk3u_wxsqlite3-3.2"} |g' Makefile
33 install -D ${lib.optionalString stdenv.hostPlatform.isDarwin "wxsqliteplus.app/Contents/MacOS/"}wxsqliteplus $out/bin/wxsqliteplus
34 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
35 mkdir -p $out/Applications
36 mv wxsqliteplus.app $out/Applications/
40 description = "Simple SQLite database browser built with wxWidgets";
41 mainProgram = "wxsqliteplus";
42 homepage = "https://github.com/guanlisheng/wxsqliteplus";
43 license = licenses.gpl3Plus;
45 platforms = platforms.unix;