Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, fetchFromGitHub 2, withMySQL ? true, withPSQL ? false, withSQLite ? false 3, mariadb, postgresql, sqlite, gawk, gnugrep, findutils, gnused 4, lib 5}: 6 7stdenv.mkDerivation rec { 8 pname = "shmig"; 9 version = "1.0.0"; 10 11 src = fetchFromGitHub { 12 owner = "mbucc"; 13 repo = "shmig"; 14 rev = "v${version}"; 15 sha256 = "15ry1d51d6dlzzzhck2x57wrq48vs4n9pp20bv2sz6nk92fva5l5"; 16 }; 17 18 makeFlags = [ "PREFIX=$(out)" ]; 19 20 postPatch = '' 21 patchShebangs . 22 23 substituteInPlace shmig \ 24 --replace "\`which mysql\`" "${lib.optionalString withMySQL "${mariadb.client}/bin/mysql"}" \ 25 --replace "\`which psql\`" "${lib.optionalString withPSQL "${postgresql}/bin/psql"}" \ 26 --replace "\`which sqlite3\`" "${lib.optionalString withSQLite "${sqlite}/bin/sqlite3"}" \ 27 --replace "awk" "${gawk}/bin/awk" \ 28 --replace "grep" "${gnugrep}/bin/grep" \ 29 --replace "find" "${findutils}/bin/find" \ 30 --replace "sed" "${gnused}/bin/sed" 31 ''; 32 33 preBuild = '' 34 mkdir -p $out/bin 35 ''; 36 37 meta = with lib; { 38 description = "Minimalistic database migration tool with MySQL, PostgreSQL and SQLite support"; 39 homepage = "https://github.com/mbucc/shmig"; 40 license = licenses.bsd3; 41 maintainers = with maintainers; [ ]; 42 }; 43}