From 61d847dc95c0a28fbbbf5981deb1d637d9f6d9fd Mon Sep 17 00:00:00 2001 From: Adriano Peluso
Date: Fri, 28 Apr 2017 09:50:07 +0200 Subject: [PATCH 1/1] gnu: Add pgmodeler. * gnu/packages/databases.scm (pgmodeler) New variable. --- gnu/packages/databases.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 26706b827..4bd2f2f33 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -61,11 +61,13 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages popt) #:use-module (gnu packages python) + #:use-module (gnu packages qt) ;; for pgmodeler #:use-module (gnu packages rdf) #:use-module (gnu packages readline) #:use-module (gnu packages tcl) #:use-module (gnu packages tls) #:use-module (gnu packages xml) + #:use-module (gnu packages zip) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) @@ -1530,3 +1532,62 @@ file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL, etc., and an SQL engine for performing simple SQL queries.") (license (list license:lgpl2.0 license:gpl2+)))) + +(define-public pgmodeler + (package ;(inherit qtbase) + (name "pgmodeler") + (version "0.8.2") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/pgmodeler/pgmodeler/archive/v" + version + ".zip" + )) + (file-name (string-append name "-" version ".zip")) + (sha256 + (base32 + "1qyh56dxh7jwnrqy61qcmay38ifs7s9n2b3y2p9ia92fk01gd78k")))) + (native-inputs + `( + ;;("qtbase" ,qtbase) + ;;("zlib" ,zlib) + ("unzip" ,unzip) + ("pkg-config" ,pkg-config) + )) + (inputs + `(("qtbase" ,qtbase) + ("postgresql" ,postgresql) + ("libxlm" ,libxml2) + ("qtsvg" ,qtsvg))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (postgres (assoc-ref inputs "postgresql"))) + (zero? (system* "qmake" "pgmodeler.pro" + (string-append "LIBS += -L" postgres "/lib" "-lpq") + (string-append "INCLUDEPATH += " postgres "/include")))))) + (add-before 'configure 'fix-project-files + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (qtbase (assoc-ref inputs "qtbase"))) + (substitute* "pgmodeler.pri" + (("PREFIX = /usr/local") + (string-append "PREFIX = " + out "/usr/local")))))) + (add-before 'check 'set-display + (lambda _ + ;; make Qt render "offscreen", required for tests + (setenv "QT_QPA_PLATFORM" "offscreen") + #t))))) + (synopsis "Graphical modeler for Postgresql") + (description "Easily create and edit database models +with simple and intuitive interface. +The software's forms indicate which fields +must be filled in order to provide +the correct generation of SQL code.") + (home-page "https://www.pgmodeler.com.br") + (license license:gpl3))) -- 2.13.0