Skip to content

Commit

Permalink
Merge branch 'agg-271-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
GerHobbelt committed Feb 7, 2024
2 parents a7aa152 + e649b70 commit 6f5324d
Show file tree
Hide file tree
Showing 46 changed files with 942 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-util0-dev
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-util0-dev libxcb-cursor-dev
pip install ninja "conan>=1.51.0,<2.0.0"
conan profile new --detect default
conan profile update settings.compiler.libcxx=libstdc++11 default
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ One of the examples is an SVG Viewer.
Cloned with history on May 6, 2019 (rev r132) from the official Sourceforge AGG project at
https://svn.code.sf.net/p/agg/svn.

Updated with history on August 28, 2023 (rev r139)

## License

AGG 2.6, along with the official Sourceforge AGG project, is based off of AGG 2.4, which
AGG 2.7, along with the official Sourceforge AGG project, is based off of AGG 2.4, which
is dual licensed by either a Modified BSD License, or an Anti-Grain Geometry Public License.
These licenses allow for free use in commercial software.

Expand Down
2 changes: 1 addition & 1 deletion agg-src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED( VERSION 3.13 )

PROJECT( agg
VERSION 2.6.1
VERSION 2.7.1
LANGUAGES CXX)

INCLUDE(GNUInstallDirs)
Expand Down
134 changes: 68 additions & 66 deletions agg-src/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,48 @@
# pylint: disable=no-member
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime
from conan.tools.files import copy, rmdir

import os

required_conan_version = '>=1.51.0, <2.0.0' # pylint: disable=invalid-name
from conan.tools.files import copy, get, rmdir

required_conan_version = ">=1.53.0"

class AggConan(ConanFile):
name = 'agg'
version = '2.6.0'
description = 'AGG Anti-Grain Geometry Library'
topics = ('graphics')
url = 'https://github.com/aggeom/agg-2.6'
homepage = 'https://github.com/aggeom'
license = 'BSD-3-Clause'
exports_sources = '*'

settings = 'os', 'arch', 'compiler', 'build_type'
name = "aggeom-agg"
version = '2.7.1'
description = "AGG Anti-Grain Geometry Library"
license = "BSD-3-Clause"
url = "https://github.com/aggeom/agg-2.6"
homepage = "https://github.com/aggeom"
topics = ("graphics",)

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
'shared': [False],
'fPIC': [True, False],
'with_gpc': [True, False],
'with_freetype': [True, False],
'with_agg2d': [True, False],
'with_agg2d_freetype': [True, False],
'with_platform': [True, False],
'with_controls': [True, False],
"shared": [True, False],
"fPIC": [True, False],
"with_gpc": [True, False],
"with_freetype": [True, False],
"with_agg2d": [True, False],
"with_agg2d_freetype": [True, False],
"with_platform": [True, False],
"with_controls": [True, False],
}

default_options = {
'shared': False,
'fPIC': True,
'with_gpc': True,
'with_freetype': True,
'with_agg2d': True,
'with_agg2d_freetype': True,
'with_platform': True,
'with_controls': True,
"shared": False,
"fPIC": True,
"with_gpc": True,
"with_freetype": True,
"with_agg2d": True,
"with_agg2d_freetype": True,
"with_platform": True,
"with_controls": True,
}

@property
def _build_subfolder(self):
return os.path.join(self.build_folder, 'agg')
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
Expand All @@ -56,23 +53,29 @@ def layout(self):

def requirements(self):
if self.options.with_freetype:
self.requires('freetype/2.13.0')
self.requires("freetype/2.13.0")
if self.options.with_platform and self.settings.os in ["Linux"]:
self.requires("xorg/system")

def validate(self):
if self.settings.os not in ("Windows", "Linux"):
raise ConanInvalidConfiguration("OS is not supported")
if self.options.shared:
raise ConanInvalidConfiguration("Invalid configuration")

def generate(self):
tc = CMakeToolchain(self)
tc.variables['agg_USE_EXPAT'] = False
tc.variables['agg_USE_SDL_PLATFORM'] = False
tc.variables['agg_BUILD_DEMO'] = False
tc.variables['agg_BUILD_EXAMPLES'] = False
tc.variables['agg_USE_GPC'] = self.options.with_gpc
tc.variables['agg_USE_FREETYPE'] = self.options.with_freetype
tc.variables['agg_USE_AGG2D'] = self.options.with_agg2d
tc.variables['agg_USE_AGG2D_FREETYPE'] = self.options.with_agg2d_freetype
tc.variables['agg_BUILD_PLATFORM'] = self.options.with_platform
tc.variables['agg_BUILD_CONTROLS'] = self.options.with_controls
tc.variables["agg_USE_EXPAT"] = False
tc.variables["agg_USE_SDL_PLATFORM"] = False
tc.variables["agg_BUILD_DEMO"] = False
tc.variables["agg_BUILD_EXAMPLES"] = False

tc.variables["agg_USE_GPC"] = self.options.with_gpc
tc.variables["agg_USE_FREETYPE"] = self.options.with_freetype
tc.variables["agg_USE_AGG2D"] = self.options.with_agg2d
tc.variables["agg_USE_AGG2D_FREETYPE"] = self.options.with_agg2d_freetype
tc.variables["agg_BUILD_PLATFORM"] = self.options.with_platform
tc.variables["agg_BUILD_CONTROLS"] = self.options.with_controls

tc.generate()

Expand All @@ -92,45 +95,44 @@ def package(self):
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))

def package_info(self):

self.cpp_info.set_property("cmake_file_name", "agg")

lib_suffix = "d" if self.settings.build_type == "Debug" and self.options.debug_suffix else ""
self.cpp_info.filenames["cmake_find_package"] = "agg"
self.cpp_info.filenames["cmake_find_package_multi"] = "agg"
self.cpp_info.names["cmake_find_package"] = "agg"
self.cpp_info.names["cmake_find_package_multi"] = "agg"

self.cpp_info.components["agg"].set_property("cmake_target_name", "agg::agg")
self.cpp_info.components["agg"].libs = ["agg" + lib_suffix]
self.cpp_info.components["agg"].libs = ["agg"]
self.cpp_info.components["agg"].includedirs = [os.path.join("include", "agg")]

if self.options.with_freetype:
self.cpp_info.components["fontfreetype"].set_property("cmake_target_name", "agg::fontfreetype")
self.cpp_info.components["fontfreetype"].libs = ["aggfontfreetype" + lib_suffix]
self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg","fontfreetype")]
self.cpp_info.components["2d"].requires = ["agg"]
self.cpp_info.components["fontfreetype"].libs = ["aggfontfreetype"]
self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg", "fontfreetype")]
self.cpp_info.components["fontfreetype"].requires = ["agg", "freetype::freetype"]

if self.options.with_gpc:
self.cpp_info.components["gpc"].set_property("cmake_target_name", "agg::gpc")
self.cpp_info.components["gpc"].libs = [ "agggpc" + lib_suffix]
self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg","gpc")]

self.cpp_info.components["gpc"].libs = ["agggpc"]
self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg", "gpc")]

if self.options.with_agg2d:
self.cpp_info.components["2d"].set_property("cmake_target_name", "agg::2d")
self.cpp_info.components["2d"].libs = ["agg2d" + lib_suffix]
self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg","2d")]
self.cpp_info.components["2d"].libs = ["agg2d"]
self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg", "2d")]
self.cpp_info.components["2d"].requires = ["agg"]
if self.options.with_agg2d_freetype:
self.cpp_info.components["2d"].requires = ["agg", "fontfreetype"]

if self.options.with_platform:

self.cpp_info.components["platform"].set_property("cmake_target_name", "agg::platform")
self.cpp_info.components["platform"].libs = ["aggplatform" + lib_suffix]
self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg","platform")]
self.cpp_info.components["platform"].libs = ["aggplatform"]
self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg", "platform")]
if self.settings.os in ["Linux"]:
self.cpp_info.components["platform"].requires = ["xorg::xorg", "agg"]

if self.options.with_controls:
self.cpp_info.components["controls"].set_property("cmake_target_name", "agg::controls")
self.cpp_info.components["controls"].libs = ["aggctrl" + lib_suffix]
self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg","ctrl")]
self.cpp_info.components["controls"].libs = ["aggctrl"]
self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg", "ctrl")]
self.cpp_info.components["controls"].requires = ["agg"]
3 changes: 1 addition & 2 deletions agg-src/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(agg, 2.6.0)
AC_INIT(agg, 2.7.1)
AC_CONFIG_SRCDIR(src/agg_arc.cpp)
AC_CANONICAL_TARGET
AC_CONFIG_HEADERS(include/config.h)
Expand Down Expand Up @@ -127,7 +127,6 @@ AC_SUBST(x_libraries)
dnl ###############################################

dnl Settung up library version
AGG_LIB_VERSION="2:6:0"
dnl current-´ / /
dnl revision--´ /
dnl age---´
Expand Down
35 changes: 7 additions & 28 deletions agg-src/examples/BeOS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -338,48 +338,27 @@ clean:
rm -rf gpc_test

agg.ppm:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/agg.ppm to /examples/X11/"
@echo "Attempting to retrieve via wget: (will fail if wget is not installed)"
wget http://www.antigrain.com/agg.ppm
cp ../art/agg.ppm .

compositing.ppm:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/compositing.ppm to /examples/X11/"
@echo "Attempting to retrieve via wget: (will fail if wget is not installed)"
wget http://www.antigrain.com/compositing.ppm
cp ../art/compositing.ppm .

spheres.ppm:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/spheres.ppm to /examples/X11/"
@echo "Attempting to retrieve file: (will fail if wget is not installed)"
wget http://www.antigrain.com/spheres.ppm
cp ../art/spheres.ppm .

shapes.txt:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/shapes.txt to /examples/X11/"
@echo "Attempting to retrieve file: (will fail if wget is not installed)"
wget http://www.antigrain.com/shapes.txt
cp ../art/shapes.txt .

1.sdf:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/1.sdf to /examples/macosx_carbon/"
@echo "Attempting to retrieve file: (will fail if wget is not installed)"
wget http://www.antigrain.com/1.sdf
cp ../art/1.sdf .

1.ppm:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/line_patterns.tar.gz to /examples/X11/ and decompress it"
@echo "Attempting to retrieve file: (will fail if wget is not installed)"
wget http://www.antigrain.com/line_patterns.tar.gz
cp ../art/line_patterns.tar.gz .
gunzip line_patterns.tar.gz
tar -xvf line_patterns.tar

timesi.ttf:
@echo "Required file missing!!"
@echo "Please download http://www.antigrain.com/timesi.zip to /examples/X11/ and decompress it"
@echo "Attempting to retrieve file: (will fail if wget is not installed)"
wget http://www.antigrain.com/timesi.zip
cp ../art/timesi.zip .
unzip -o timesi.zip

../freetype_test.o: ../freetype_test.cpp
Expand Down
33 changes: 33 additions & 0 deletions agg-src/examples/X11/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \
-I../../include \
-I../../font_freetype \
-I/usr/local/include/freetype2 \
-I/usr/include/freetype2 \
-L../../src \
$(PIXFMT)

Expand Down Expand Up @@ -277,6 +278,38 @@ gpc_test: ../gpc_test.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES)
svg_test: ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) tiger.svg
$(CXX) $(CXXFLAGS) ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) -o svg_test $(LIBS) -lfreetype -lexpat

clean:
rm -f ../*.o
rm -f ../svg_viewer/*.o
rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o

agg.ppm:
cp ../art/agg.ppm .

compositing.ppm:
cp ../art/compositing.ppm .

spheres.ppm:
cp ../art/spheres.ppm .

shapes.txt:
cp ../art/shapes.txt .

1.sdf:
cp ../art/1.sdf .

1.ppm:
cp ../art/line_patterns.tar.gz .
gunzip line_patterns.tar.gz
tar -xvf line_patterns.tar

timesi.ttf:
cp ../art/timesi.zip .
unzip -o timesi.zip

tiger.svg:
cp ../art/tiger.svg .

../freetype_test.o: ../freetype_test.cpp
@echo \< $*.cpp \>
$(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@
Expand Down
Binary file added agg-src/examples/X11/line_patterns.tar.gz
Binary file not shown.
Loading

0 comments on commit 6f5324d

Please sign in to comment.