Skip to content

Commit

Permalink
Use libgit 1.7.1 for macos only
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellMorgenstern committed Dec 12, 2023
1 parent 9429856 commit 86db727
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 37 deletions.
65 changes: 42 additions & 23 deletions pri/libgit2detect.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@
# along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
# ********************************************************************

# 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 {
Expand All @@ -47,25 +48,43 @@ 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) {
message("found libgit2 library in $$LIBGIT2LIB")
} 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
}
}

35 changes: 21 additions & 14 deletions pri/quazipdetect.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 {
Expand All @@ -39,7 +46,7 @@ win32 {
} else {
message("Fritzing requires quazip")
error("quazip include path not found in $$QUAZIPINCLUDE")
}
}

INCLUDEPATH += $$QUAZIPINCLUDE

Expand All @@ -56,4 +63,4 @@ win32 {
}

LIBS += -L$$QUAZIPLIB -lquazip1-qt$$QT_MAJOR_VERSION
}
}

0 comments on commit 86db727

Please sign in to comment.