Commit 52dd35fe authored by Sebastian Ramacher's avatar Sebastian Ramacher

Convert to meson build system

parent eb87bd74
*.o *.o
*~ *~
.depend
pdf.so pdf.so
*.swp *.swp
zathura-version-check
.ycm_extra_conf.* .ycm_extra_conf.*
compile_commands.json compile_commands.json
tags tags
build/
# See LICENSE file for license and copyright information
# General information
PROJECT_NAME = zathura-pdf-mupdf
OUTPUT_DIRECTORY = ./doc/
OUTPUT_LANGUAGE = English
TAB_SIZE = 2
EXTRACT_ALL = YES
OPTIMIZE_OUTPUT_FOR_C = YES
DOXYFILE_ENCODING = UTF-8
TYPEDEF_HIDES_STRUCT = YES
# Warning and progress messages
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
# Input files
INPUT =
FILE_PATTERNS = *.h *.c
RECURSIVE = YES
# Output files
GENERATE_HTML = YES
GENERATE_LATEX = NO
GENERATE_RTF = NO
GENERATE_XML = NO
SOURCE_BROWSER = YES
# See LICENSE file for license and copyright information
include config.mk
include common.mk
PROJECT = zathura-pdf-mupdf
PLUGIN = pdf
SOURCE = $(sort $(wildcard *.c))
HEADER = $(sort $(wildcard *.h))
OBJECTS = ${SOURCE:.c=.o}
DOBJECTS = ${SOURCE:.c=.do}
CPPFLAGS += "-DVERSION_MAJOR=${VERSION_MAJOR}"
CPPFLAGS += "-DVERSION_MINOR=${VERSION_MINOR}"
CPPFLAGS += "-DVERSION_REV=${VERSION_REV}"
all: options ${PLUGIN}.so
zathura-version-check:
ifneq ($(ZATHURA_VERSION_CHECK), 0)
$(error "The minimum required version of zathura is ${ZATHURA_MIN_VERSION}")
endif
$(QUIET)touch zathura-version-check
options:
$(ECHO) ${PLUGIN} build options:
$(ECHO) "CFLAGS = ${CFLAGS}"
$(ECHO) "LDFLAGS = ${LDFLAGS}"
$(ECHO) "DFLAGS = ${DFLAGS}"
$(ECHO) "CC = ${CC}"
%.o: %.c
$(ECHO) CC $<
@mkdir -p .depend
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
%.do: %.c
$(ECHO) CC $<
@mkdir -p .depend
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
${OBJECTS}: config.mk zathura-version-check
${DOBJECTS}: config.mk zathura-version-check
${PLUGIN}.so: ${OBJECTS}
$(ECHO) LD $@
$(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(OBJECTS) ${LIBS}
${PLUGIN}-debug.so: ${DOBJECTS}
$(ECHO) LD $@
$(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(DOBJECTS) ${LIBS}
clean:
$(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so $(PLUGIN)-debug.so \
doc .depend ${PROJECT}-${VERSION}.tar.gz zathura-version-check
debug: options ${PLUGIN}-debug.so
dist: clean
$(QUIET)mkdir -p ${PROJECT}-${VERSION}
$(QUIET)cp -R LICENSE Makefile config.mk common.mk Doxyfile \
${HEADER} ${SOURCE} AUTHORS ${PROJECT}.desktop \
${PROJECT}-${VERSION}
$(QUIET)tar -cf ${PROJECT}-${VERSION}.tar ${PROJECT}-${VERSION}
$(QUIET)gzip ${PROJECT}-${VERSION}.tar
$(QUIET)rm -rf ${PROJECT}-${VERSION}
doc: clean
$(QUIET)doxygen Doxyfile
install: all
$(ECHO) installing ${PLUGIN} plugin
$(QUIET)mkdir -p ${DESTDIR}${PLUGINDIR}
$(QUIET)cp -f ${PLUGIN}.so ${DESTDIR}${PLUGINDIR}
$(QUIET)mkdir -m 755 -p ${DESTDIR}${DESKTOPPREFIX}
$(ECHO) installing desktop file
$(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
uninstall:
$(ECHO) uninstalling ${PLUGIN} plugin
$(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.so
$(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${PLUGINDIR} 2> /dev/null
$(ECHO) removing desktop file
$(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
$(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
-include $(wildcard .depend/*.dep)
.PHONY: all options clean debug doc dist install uninstall
# See LICENSE file for license and copyright information
ifeq "$(VERBOSE)" "0"
ECHO=@echo
QUIET=@
else
ECHO=@\#
QUIET=
endif
# See LICENSE file for license and copyright information
VERSION_MAJOR = 0
VERSION_MINOR = 3
VERSION_REV = 2
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
PKG_CONFIG ?= pkg-config
# minimum required zathura version
ZATHURA_MIN_VERSION = 0.3.8
ZATHURA_VERSION_CHECK ?= $(shell $(PKG_CONFIG) --atleast-version=$(ZATHURA_MIN_VERSION) zathura; echo $$?)
# paths
PREFIX ?= /usr
LIBDIR ?= ${PREFIX}/lib
DESKTOPPREFIX ?= ${PREFIX}/share/applications
# libs
CAIRO_INC ?= $(shell $(PKG_CONFIG) --cflags cairo)
CAIRO_LIB ?= $(shell $(PKG_CONFIG) --libs cairo)
GTK_INC ?= $(shell $(PKG_CONFIG) --cflags gtk+-3.0)
GTK_LIB ?= $(shell $(PKG_CONFIG) --libs gtk+-3.0)
GIRARA_INC ?= $(shell $(PKG_CONFIG) --cflags girara-gtk3)
GIRARA_LIB ?= $(shell $(PKG_CONFIG) --libs girara-gtk3)
ZATHURA_INC ?= $(shell $(PKG_CONFIG) --cflags zathura)
PLUGINDIR ?= $(shell $(PKG_CONFIG) --variable=plugindir zathura)
ifeq (,${PLUGINDIR})
PLUGINDIR = ${LIBDIR}/zathura
endif
OPENSSL_INC ?= $(shell $(PKG_CONFIG) --cflags libcrypto)
OPENSSL_LIB ?= $(shell $(PKG_CONFIG) --libs libcrypto)
FREETYPE_INC ?= $(shell $(PKG_CONFIG) --cflags freetype2)
FREETYPE_LIB ?= $(shell $(PKG_CONFIG) --libs freetype2)
HARFBUZZ_INC ?= $(shell $(PKG_CONFIG) --cflags harfbuzz)
HARFBUZZ_LIB ?= $(shell $(PKG_CONFIG) --libs harfbuzz)
MUPDF_LIB ?= -lmupdf -lmupdfthird
INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${CAIRO_INC} ${ZATHURA_INC} ${FREETYPE_INC} ${HARFBUZZ_INC}
LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} ${CAIRO_LIB} ${FREETYPE_LIB} ${HARFBUZZ_LIB}
# compiler flags
CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
# linker flags
LDFLAGS += -fPIC
# debug
DFLAGS ?= -g
# compiler
CC ?= gcc
LD ?= ld
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
install_data('org.pwmt.zathura-pdf-mupdf.metainfo.xml', install_dir: metainfodir)
install_data('org.pwmt.zathura-pdf-mupdf.desktop', install_dir: desktopdir)
[Desktop Entry]
Version=1.0
Type=Application
Name=Zathura
Comment=A minimalistic document viewer
Exec=zathura %U
Terminal=false
NoDisplay=true
Categories=Office;Viewer;
MimeType=application/pdf;application/oxps;application/epub+zip;
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2015-2018 pwmt.org -->
<component type="addon">
<id>org.pwmt.zathura-pdf-mupdf</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>Zlib</project_license>
<extends>org.pwmt.zathura</extends>
<name>Zathura-PDF-MuPDF</name>
<summary>PDF plugin for zathura based on MuPDF</summary>
<url type="homepage">https://pwmt.org/projects/zathura-pdf-mupdf/</url>
<update_contact>zathura@lists.pwmt.org</update_contact>
</component>
project('zathura-pdf-mupdf', 'c',
version: '0.3.2',
meson_version: '>=0.43',
default_options: 'c_std=c11'
)
version = meson.project_version()
version_array = version.split('.')
cc = meson.get_compiler('c')
prefix = get_option('prefix')
datadir = get_option('datadir')
metainfodir = join_paths(datadir, 'metainfo')
desktopdir = join_paths(datadir, 'applications')
# required dependencies
zathura = dependency('zathura', version: '>=0.3.8')
girara = dependency('girara-gtk3')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
mupdf = cc.find_library('mupdf')
mupdfthird = cc.find_library('mupdfthird')
build_dependencies = [zathura, girara, glib, cairo, mupdf, mupdfthird]
# defines
defines = [
'-DVERSION_MAJOR=@0@'.format(version_array[0]),
'-DVERSION_MINOR=@0@'.format(version_array[1]),
'-DVERSION_REV=@0@'.format(version_array[2]),
'-D_DEFAULT_SOURCE',
]
# compile flags
flags = [
'-Wall',
'-Wextra',
'-pedantic',
'-Werror=implicit-function-declaration',
'-Werror=vla',
'-fvisibility=hidden'
]
flags = cc.get_supported_arguments(flags)
sources = files(
'document.c',
'image.c',
'index.c',
'links.c',
'page.c',
'plugin.c',
'render.c',
'search.c',
'select.c',
'utils.c'
)
pdf = shared_module('pdf-mupdf',
sources,
dependencies: build_dependencies,
c_args: defines + flags,
install: true,
install_dir: zathura.get_pkgconfig_variable('plugindir')
)
subdir('data')
/* See LICENSE file for license and copyright information */ /* See LICENSE file for license and copyright information */
#define _POSIX_C_SOURCE 1
#include "plugin.h" #include "plugin.h"
ZATHURA_PLUGIN_REGISTER_WITH_FUNCTIONS( ZATHURA_PLUGIN_REGISTER_WITH_FUNCTIONS(
......
[Desktop Entry]
Version=1.0
Type=Application
Name=Zathura
Comment=A minimalistic document viewer
Comment[ca]=Un visualitzador de documents minimalista
Comment[de]=Ein minimalistischer Dokumenten-Betrachter
Comment[el]=Ένας ελαφρύς προβολέας κειμένων
Comment[eo]=Malpeza dokumento spektanto
Comment[es_CL]=Un visor de documentos minimalista
Comment[fr]=Un visionneur de document minimaliste
Comment[he]=מציג מסמכים מינימליסטי
Comment[id_ID]=Pembaca dokumen minimalis
Comment[it]=Un visualizzatore di documenti minimalista
Comment[pl]=Minimalistyczna przeglądarka dokumentów
Comment[pt_BR]=Um visualizador de documentos minimalista
Comment[ru]=Минималистичный просмотрщик документов
Comment[tr]=Minimalist bir belge görüntüleyicisi
Comment[uk_UA]=Легкий переглядач документів
Exec=zathura %U
Terminal=false
NoDisplay=true
Categories=Office;Viewer;
MimeType=application/pdf;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment