Skip to content

Commit

Permalink
Add qbs scripts for KArchive and use in rpmap plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Nov 1, 2020
1 parent 3574278 commit 43c4b1d
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 12 deletions.
51 changes: 51 additions & 0 deletions src/KArchive/KArchive.qbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import qbs 1.0

StaticLibrary {
targetName: "KArchive"

Depends { name: "cpp" }
Depends { name: "Qt"; submodules: "gui"; versionAtLeast: "5.6" }

cpp.includePaths: [ "src" ]
cpp.defines: [ "KARCHIVE_STATIC_DEFINE" ]

files : [
"src/config-compression.h",
// "src/k7zip.cpp", // requires xz to build
"src/k7zip.h",
"src/kar.cpp",
"src/kar.h",
"src/karchivedirectory.h",
"src/karchiveentry.h",
"src/karchivefile.h",
"src/karchive_export.h",
"src/karchive_p.h",
"src/karchive.cpp",
"src/karchive.h",
"src/kbzip2filter.cpp",
"src/kbzip2filter.h",
"src/kcompressiondevice.cpp",
"src/kcompressiondevice.h",
"src/kcompressiondevice_p.h",
"src/kfilterbase.cpp",
"src/kfilterbase.h",
"src/kfilterdev.cpp",
"src/kfilterdev.h",
"src/kgzipfilter.cpp",
"src/kgzipfilter.h",
"src/klimitediodevice.cpp",
"src/klimitediodevice_p.h",
"src/knonefilter.cpp",
"src/knonefilter.h",
"src/krcc.cpp",
"src/krcc.h",
"src/ktar.cpp",
"src/ktar.h",
// "src/kxzfilter.cpp",
"src/kxzfilter.h",
"src/kzipfileentry.h",
"src/kzip.cpp",
"src/kzip.h",
"src/loggingcategory.h",
]
}
Empty file.
122 changes: 122 additions & 0 deletions src/KArchive/src/karchive_export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

#ifndef KARCHIVE_EXPORT_H
#define KARCHIVE_EXPORT_H

#ifdef KARCHIVE_STATIC_DEFINE
# define KARCHIVE_EXPORT
# define KARCHIVE_NO_EXPORT
#else
# ifndef KARCHIVE_EXPORT
# ifdef KF5Archive_EXPORTS
/* We are building this library */
# define KARCHIVE_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define KARCHIVE_EXPORT __attribute__((visibility("default")))
# endif
# endif

# ifndef KARCHIVE_NO_EXPORT
# define KARCHIVE_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif

#ifndef KARCHIVE_DECL_DEPRECATED
# define KARCHIVE_DECL_DEPRECATED __attribute__ ((__deprecated__))
#endif

#ifndef KARCHIVE_DECL_DEPRECATED_EXPORT
# define KARCHIVE_DECL_DEPRECATED_EXPORT KARCHIVE_EXPORT KARCHIVE_DECL_DEPRECATED
#endif

#ifndef KARCHIVE_DECL_DEPRECATED_NO_EXPORT
# define KARCHIVE_DECL_DEPRECATED_NO_EXPORT KARCHIVE_NO_EXPORT KARCHIVE_DECL_DEPRECATED
#endif

#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef KARCHIVE_NO_DEPRECATED
# define KARCHIVE_NO_DEPRECATED
# endif
#endif

#define KARCHIVE_DECL_DEPRECATED_TEXT(text) __attribute__ ((__deprecated__(text)))

#define ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, patch) ((major<<16)|(minor<<8)|(patch))

/* Take any defaults from group settings */
#if !defined(KARCHIVE_NO_DEPRECATED) && !defined(KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT)
# ifdef KF_NO_DEPRECATED
# define KARCHIVE_NO_DEPRECATED
# elif defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT)
# define KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT
# endif
#endif
#if !defined(KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT) && defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT)
# define KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT
#endif

#if !defined(KARCHIVE_NO_DEPRECATED_WARNINGS) && !defined(KARCHIVE_DEPRECATED_WARNINGS_SINCE)
# ifdef KF_NO_DEPRECATED_WARNINGS
# define KARCHIVE_NO_DEPRECATED_WARNINGS
# elif defined(KF_DEPRECATED_WARNINGS_SINCE)
# define KARCHIVE_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE
# endif
#endif
#if !defined(KARCHIVE_DEPRECATED_WARNINGS_SINCE) && defined(KF_DEPRECATED_WARNINGS_SINCE)
# define KARCHIVE_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE
#endif

#if defined(KARCHIVE_NO_DEPRECATED)
# undef KARCHIVE_DEPRECATED
# define KARCHIVE_DEPRECATED_EXPORT KARCHIVE_EXPORT
# define KARCHIVE_DEPRECATED_NO_EXPORT KARCHIVE_NO_EXPORT
#elif defined(KARCHIVE_NO_DEPRECATED_WARNINGS)
# define KARCHIVE_DEPRECATED
# define KARCHIVE_DEPRECATED_EXPORT KARCHIVE_EXPORT
# define KARCHIVE_DEPRECATED_NO_EXPORT KARCHIVE_NO_EXPORT
#else
# define KARCHIVE_DEPRECATED KARCHIVE_DECL_DEPRECATED
# define KARCHIVE_DEPRECATED_EXPORT KARCHIVE_DECL_DEPRECATED_EXPORT
# define KARCHIVE_DEPRECATED_NO_EXPORT KARCHIVE_DECL_DEPRECATED_NO_EXPORT
#endif

/* No deprecated API had been removed from build */
#define KARCHIVE_EXCLUDE_DEPRECATED_BEFORE_AND_AT 0

#define KARCHIVE_BUILD_DEPRECATED_SINCE(major, minor) 1

#ifdef KARCHIVE_NO_DEPRECATED
# define KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT 0x54c00
#endif
#ifdef KARCHIVE_NO_DEPRECATED_WARNINGS
# define KARCHIVE_DEPRECATED_WARNINGS_SINCE 0
#endif

#ifndef KARCHIVE_DEPRECATED_WARNINGS_SINCE
# ifdef KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT
# define KARCHIVE_DEPRECATED_WARNINGS_SINCE KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT
# else
# define KARCHIVE_DEPRECATED_WARNINGS_SINCE 0x54c00
# endif
#endif

#ifndef KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT
# define KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT 0
#endif

#ifdef KARCHIVE_DEPRECATED
# define KARCHIVE_ENABLE_DEPRECATED_SINCE(major, minor) (ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, 0) > KARCHIVE_DISABLE_DEPRECATED_BEFORE_AND_AT)
#else
# define KARCHIVE_ENABLE_DEPRECATED_SINCE(major, minor) 0
#endif

#if KARCHIVE_DEPRECATED_WARNINGS_SINCE >= 0x50000
# define KARCHIVE_DEPRECATED_VERSION_5_0(text) KARCHIVE_DECL_DEPRECATED_TEXT(text)
#else
# define KARCHIVE_DEPRECATED_VERSION_5_0(text)
#endif
#define KARCHIVE_DEPRECATED_VERSION_5(minor, text) KARCHIVE_DEPRECATED_VERSION_5_##minor(text)
#define KARCHIVE_DEPRECATED_VERSION(major, minor, text) KARCHIVE_DEPRECATED_VERSION_##major(minor, "Since "#major"."#minor". " text)
#define KARCHIVE_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) KARCHIVE_DEPRECATED_VERSION_##major(minor, "Since "#textmajor"."#textminor". " text)

#endif /* KARCHIVE_EXPORT_H */
11 changes: 11 additions & 0 deletions src/KArchive/src/loggingcategory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was generated by ecm_qt_declare_logging_category(): DO NOT EDIT!

#ifndef ECM_QLOGGINGCATEGORY_KARCHIVELOG_LOGGINGCATEGORY_H
#define ECM_QLOGGINGCATEGORY_KARCHIVELOG_LOGGINGCATEGORY_H

#include <QLoggingCategory>

Q_DECLARE_LOGGING_CATEGORY(KArchiveLog)


#endif
8 changes: 1 addition & 7 deletions src/plugins/plugins.qbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
Project {
name: "plugins"

SubProject {
filePath: "rpmap/rpmap.qbs"
Properties {
condition: parent.enableKArchive
}
}

references: [
"csv",
"defold",
Expand All @@ -20,6 +13,7 @@ Project {
"lua",
"python",
"replicaisland",
"rpmap",
"tbin",
"tengine"
]
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/rpmap/rpmap.qbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import qbs 1.0

TiledPlugin {
cpp.defines: base.concat(["RPMAP_LIBRARY"])
cpp.includePaths: ["/usr/include/KF5/KArchive"]
// Depends { name: "KF5Archive" }
cpp.dynamicLibraries: ["KF5Archive"]
cpp.defines: base.concat(["RPMAP_LIBRARY", "KARCHIVE_STATIC_DEFINE"])
cpp.includePaths: ["../../KArchive/src"]

Depends { name: "KArchive" }

files: [
"rpmap_global.h",
Expand Down
2 changes: 1 addition & 1 deletion tiled.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Project {
property bool windowsInstaller: false
property bool enableZstd: false
property string openSslPath: Environment.getEnv("OPENSSL_PATH")
property bool enableKArchive: false

references: [
"dist/archive.qbs",
Expand All @@ -24,6 +23,7 @@ Project {
"docs",
"src/libtiled",
"src/libtiledquick",
"src/KArchive",
"src/plugins",
"src/qtpropertybrowser",
"src/qtsingleapplication",
Expand Down

0 comments on commit 43c4b1d

Please sign in to comment.