diff --git a/pri/libgit2detect.pri b/pri/libgit2detect.pri index 7458d3746..4f5018996 100644 --- a/pri/libgit2detect.pri +++ b/pri/libgit2detect.pri @@ -13,25 +13,26 @@ # along with Fritzing. If not, see . # ******************************************************************** +# Windows and Linux still use the old variant, libgit 0.28, static linked +# macOS uses already uses the 1.7.1 version +# Use libgit2 1.7.1 ( https://github.com/libgit2/libgit2/pull/6471 ) +LIBGIT_VERSION=1.7.1 +LIBGITPATH = $$absolute_path($$_PRO_FILE_PWD_/../libgit2-$$LIBGIT_VERSION) -packagesExist(libgit2) { -} else { - LIBGIT_STATIC = true -} +!macx { + if ($$LIBGIT_STATIC) { + LIBGIT2INCLUDE = "$$_PRO_FILE_PWD_/../libgit2/include" -if ($$LIBGIT_STATIC) { - LIBGIT2INCLUDE = "$$_PRO_FILE_PWD_/../libgit2/include" - exists($$LIBGIT2INCLUDE/git2.h) { - message("found libgit2 include path at $$LIBGIT2INCLUDE") - } else { - message("Fritzing requires libgit2") - message("Build it from the repo at https://github.com/libgit2") - message("See https://github.com/fritzing/fritzing-app/wiki for details.") + exists($$LIBGIT2INCLUDE/git2.h) { + message("found libgit2 include path at $$LIBGIT2INCLUDE") + } else { + message("Fritzing requires libgit2") + message("Build it from the repo at https://github.com/libgit2") + message("See https://github.com/fritzing/fritzing-app/wiki for details.") - error("libgit2 include path not found in $$LIBGIT2INCLUDE") - } - - INCLUDEPATH += $$LIBGIT2INCLUDE + error("libgit2 include path not found in $$LIBGIT2INCLUDE") + } + } } win32 { @@ -47,10 +48,11 @@ win32 { error("libgit2 library not found in $$LIBGIT2LIB") } + INCLUDEPATH += $$LIBGIT2INCLUDE LIBS += -L$$LIBGIT2LIB -lgit2 } -unix { +unix:!macx { if ($$LIBGIT_STATIC) { LIBGIT2LIB = $$_PRO_FILE_PWD_/../libgit2/build exists($$LIBGIT2LIB/libgit2.a) { @@ -58,14 +60,31 @@ unix { } else { error("static libgit2 library not found in $$LIBGIT2LIB") } - macx { - LIBS += $$LIBGIT2LIB/libgit2.a -framework Security - } else { - LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto - } + INCLUDEPATH += $$LIBGIT2INCLUDE + LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto } else { - !build_pass:warning("Using dynamic linking for libgit2.") + QMAKE_PKG_CONFIG_PATH += $$LIBGITPATH/pkgconfig + !build_pass:warning("Using dynamic linking for libgit2. This is not tested on macos, probably doesn't work.") #message("Enabled dynamic linking of libgit2") PKGCONFIG += libgit2 } } + +macx { + if ($$LIBGIT_STATIC) { + LIBGIT2LIB = $$LIBGITPATH/lib + exists($$LIBGIT2LIB/libgit2.a) { + message("found libgit2 library in $$LIBGIT2LIB") + } else { + error("static libgit2 library not found in $$LIBGIT2LIB") + } + INCLUDEPATH += $$LIBGITPATH/include + LIBS += $$LIBGIT2LIB/libgit2.a -framework Security + } else { + QMAKE_PKG_CONFIG_PATH += $$LIBGITPATH/pkgconfig + !build_pass:warning("Using dynamic linking for libgit2. This is not tested on macos, probably doesn't work") + #message("Enabled dynamic linking of libgit2") + PKGCONFIG += libgit2 + } +} + diff --git a/pri/quazipdetect.pri b/pri/quazipdetect.pri index 9f480ec6a..a44799f15 100644 --- a/pri/quazipdetect.pri +++ b/pri/quazipdetect.pri @@ -5,14 +5,16 @@ message("Using fritzing quazip detect script.") SOURCES += \ src/zlibdummy.c \ -exists($$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION)) { - QUAZIPPATH = $$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION) - message("found quazip in $${QUAZIPPATH}") - } else { - error("quazip could not be found.") - } +!macx { + exists($$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION)) { + QUAZIPPATH = $$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION) + message("found quazip in $${QUAZIPPATH}") + } else { + error("quazip could not be found.") + } -message("including $$absolute_path($${QUAZIPPATH}/include/quazip)") + message("including $$absolute_path($${QUAZIPPATH}/include/quazip)") +} unix:!macx { message("including quazip library on linux") @@ -22,11 +24,16 @@ unix:!macx { } macx { - message("including quazip library on mac os") - INCLUDEPATH += $$absolute_path($${QUAZIPPATH}/include/quazip) - LIBS += -L$$absolute_path($${QUAZIPPATH}/lib) -lquazip1-qt$$QT_MAJOR_VERSION - QMAKE_RPATHDIR += $$absolute_path($${QUAZIPPATH}/lib) - LIBS += -lz + QUAZIP_VERSION=1.4 + QUAZIP_PATH=$$absolute_path($$PWD/../../quazip-$$QT_VERSION-$$QUAZIP_VERSION) + QUAZIP_INCLUDE_PATH=$$QUAZIP_PATH/include/QuaZip-Qt6-$$QUAZIP_VERSION/quazip + QUAZIP_LIB_PATH=$$QUAZIP_PATH/lib + + message("including quazip library on mac os") + INCLUDEPATH += $$QUAZIP_INCLUDE_PATH + LIBS += -L$$QUAZIP_LIB_PATH -lquazip1-qt$$QT_MAJOR_VERSION + QMAKE_RPATHDIR += $$QUAZIP_LIB_PATH + LIBS += -lz } win32 { @@ -39,7 +46,7 @@ win32 { } else { message("Fritzing requires quazip") error("quazip include path not found in $$QUAZIPINCLUDE") - } + } INCLUDEPATH += $$QUAZIPINCLUDE @@ -56,4 +63,4 @@ win32 { } LIBS += -L$$QUAZIPLIB -lquazip1-qt$$QT_MAJOR_VERSION -} \ No newline at end of file +}