Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
583729e
feat: Add libadwaita
danyeaw Aug 30, 2025
1c8491d
Update dependency constraints
danyeaw Aug 30, 2025
aec1700
Patch out appstream for all platforms
danyeaw Aug 30, 2025
b8545bf
Add libsass-native
danyeaw Dec 27, 2025
158c00b
Add sassc
danyeaw Dec 27, 2025
6275f14
Cleanup libadwaita
danyeaw Jan 1, 2026
36b6508
Add itstool
danyeaw Jan 1, 2026
d1e64d8
Add AppStream
danyeaw Jan 1, 2026
eb2720f
Add libxmlb
danyeaw Jan 1, 2026
473673f
Fix recipe lint errors
danyeaw Jan 1, 2026
2a40385
Remove duplicate library check
danyeaw Jan 1, 2026
19ef863
Fix libsass-native Windows platform
danyeaw Jan 1, 2026
ab4ccd1
Fix appstream dependency not found on osx
danyeaw Jan 1, 2026
48467a2
Windows: fix sassc can't find libsass.targets
danyeaw Jan 1, 2026
80c1d79
Fix libadwaita needs macOS 10.14+
danyeaw Jan 1, 2026
95acb3e
Fix sassc unable to link against libsass on Windows
danyeaw Jan 1, 2026
9c7316a
Skip libxmlb on Windows
danyeaw Jan 1, 2026
46a411f
Remove check for libsass.targets
danyeaw Jan 2, 2026
689c188
Fix patch for removing AppStream
danyeaw Jan 2, 2026
3081bae
Make remove AppStream patch cross-platform
danyeaw Jan 2, 2026
5f89ef4
Build libsass-native with Meson
danyeaw Jan 2, 2026
c6ad872
Windows: fix libadwaita lib prefix
danyeaw Jan 2, 2026
cd3f4aa
Fix libxmlb script syntax
danyeaw Jan 2, 2026
6ffbd80
Update osx c stdlib versions to 10.15/11.0
danyeaw Jan 4, 2026
b8cd23f
Try setting MACOSX_DEPLOYMENT_TARGET
danyeaw Jan 4, 2026
4d14491
Try setting macOS SDK Version
danyeaw Jan 4, 2026
ea1addb
Add root conda_build_config support for config files
danyeaw Jan 4, 2026
06c6e07
Reset all macOS versions to 11.0
danyeaw Jan 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .ci_support/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ def build_all(recipes_dir, arch):
deployment_version = (0, 0)
sdk_version = (0, 0)
channel_urls = None
for folder in folders:
cbc = os.path.join(recipes_dir, folder, "conda_build_config.yaml")
config_files = [os.path.join(recipes_dir, "conda_build_config.yaml")]
config_files.extend(
[
os.path.join(recipes_dir, folder, "conda_build_config.yaml")
for folder in folders
]
)
for cbc in config_files:
if os.path.exists(cbc):
with open(cbc, "r") as f:
lines = f.readlines()
Expand Down Expand Up @@ -290,11 +296,14 @@ def build_folders_rattler_build(
specs = OrderedDict()
for f in config.exclusive_config_files:
specs[f] = conda_build.variants.parse_config_file(
os.path.abspath(os.path.expanduser(os.path.expandvars(f))), config, loader=yaml.SafeLoader
os.path.abspath(os.path.expanduser(os.path.expandvars(f))),
config,
loader=yaml.SafeLoader,
)

variants = list(Path(recipes_dir).glob(f"**/conda_build_config.yaml")) \
+ list(Path(recipes_dir).glob(f"**/variants.yaml"))
variants = list(Path(recipes_dir).glob("**/conda_build_config.yaml")) + list(
Path(recipes_dir).glob("**/variants.yaml")
)
if len(variants) > 1:
raise ValueError(
f"Found multiple variant config files in the recipes: {variants}. "
Expand Down
90 changes: 90 additions & 0 deletions recipes/appstream/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json
schema_version: 1

context:
name: AppStream
version: "1.1.1"

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://www.freedesktop.org/software/${{ name|lower }}/releases/${{ name }}-${{ version }}.tar.xz
sha256: 3b9d325074ede328eed4746d0c4fbfc3b8f6f4fdbc9c173ed70e40569a79b117

build:
number: 0
skip:
- win
script: |
meson setup ${MESON_ARGS} \
--prefix=$PREFIX \
--default-library=shared \
--wrap-mode=nofallback \
-Dc_args="-D_GNU_SOURCE" \
-Dgir=true \
-Ddocs=false \
-Dapidocs=false \
-Dman=false \
-Dvapi=false \
-Dsystemd=false \
-Dstemming=false \
builddir
ninja -v -C builddir -j ${CPU_COUNT}
ninja -C builddir install -j ${CPU_COUNT}

requirements:
build:
- ${{ compiler('c') }}
- ${{ stdlib('c') }}
- meson >=0.62.0
- ninja
- pkg-config
- gobject-introspection
- python
host:
- glib >=2.58
- libxml2-devel
- zlib
- libcurl
- libfyaml
- libxmlb
- gobject-introspection
- gperf
- gettext
- itstool
- python
run:
- python

tests:
- package_contents:
files:
- lib/pkgconfig/appstream.pc
- bin/appstreamcli
- share/gir-1.0/AppStream-1.0.gir
- lib/girepository-1.0/AppStream-1.0.typelib
lib:
- appstream

about:
homepage: https://www.freedesktop.org/wiki/Distributions/AppStream/
summary: 'Tools and libraries to work with AppStream metadata'
description: |
AppStream makes machine-readable software metadata
easily accessible. It is a foundational block for
modern Linux software centers, offering a seamless
way to retrieve information about available software,
no matter the repository it is contained in. It can
provide data about available applications as well as
available firmware, drivers, fonts and other components.
This project is part of freedesktop.org.
license: LGPL-2.1-or-later
license_file: COPYING
documentation: https://www.freedesktop.org/software/appstream/docs/
repository: https://github.com/ximion/appstream

extra:
recipe-maintainers:
- danyeaw
14 changes: 14 additions & 0 deletions recipes/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# libadwaita requires NSColor.controlAccentColor (macOS 10.14+)
# Setting SDK to 11.0 to ensure API availability
c_stdlib_version:
- 11.0 # [osx]

MACOSX_DEPLOYMENT_TARGET:
- 11.0 # [osx]

MACOSX_SDK_VERSION:
- 11.0 # [osx]

# itstool and AppStream require libxml2 2.15
libxml2_devel:
- 2.15
90 changes: 90 additions & 0 deletions recipes/itstool/0001-Fix-the-crash-from-912099.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tanguy Ortolo <[email protected]>
Date: Fri, 7 Dec 2018 00:00:00 +0000
Subject: [PATCH] Fix the crash from #912099

ITS Tool 2.0.4 crashes when building some documentation, as reported in #912099.
This comes from translations with invalid XML markup, which ITS Tool fails to
merge (which is not abnormal), and to report these issues, needlessly encodes
the original msgstr from unicode to bytes, causing it to be recoded using the
default ascii codec, which fails when the msgstr contains anything out of ascii.

This patch removes the useless decoding, avoiding the failing subsequent
recoding. It also explicitly encodes the output strings to be able to print them
in all cases, even when the output encoding cannot be detected.

Bug: https://github.com/itstool/itstool/issues/25
Bug-Debian: https://bugs.debian.org/912099
Forwarded: https://github.com/itstool/itstool/issues/25
---
itstool.in | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/itstool.in b/itstool.in
index c21ad4bfeb86..f34673581c88 100755
--- a/itstool.in
+++ b/itstool.in
@@ -44,9 +44,22 @@ if PY3:
else:
return str(s)
ustr_type = str
+ def pr_str(s):
+ """Return a string that can be safely print()ed"""
+ # Since print works on both bytes and unicode, just return the argument
+ return s
else:
string_types = basestring,
ustr = ustr_type = unicode
+ def pr_str(s):
+ """Return a string that can be safely print()ed"""
+ if isinstance(s, str):
+ # Since print works on str, just return the argument
+ return s
+ else:
+ # print may not work on unicode if the output encoding cannot be
+ # detected, so just encode with UTF-8
+ return unicode.encode(s, 'utf-8')

NS_ITS = 'http://www.w3.org/2005/11/its'
NS_ITST = 'http://itstool.org/extensions/'
@@ -1077,36 +1090,36 @@ class Document (object):
if strict:
raise
else:
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
(lang + ' ') if lang is not None else '',
- msgstr.encode('utf-8')))
+ msgstr)))
self._xml_err = ''
return node
def scan_node(node):
children = [child for child in xml_child_iter(node)]
for child in children:
if child.type != 'element':
continue
if child.ns() is not None and child.ns().content == NS_BLANK:
ph_node = msg.get_placeholder(child.name).node
if self.has_child_elements(ph_node):
self.merge_translations(translations, None, ph_node, strict=strict)
newnode = ph_node.copyNode(1)
newnode.setTreeDoc(self._doc)
child.replaceNode(newnode)
else:
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
child.replaceNode(repl)
scan_node(child)
try:
scan_node(trnode)
except:
if strict:
raise
else:
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
(lang + ' ') if lang is not None else '',
- msgstr.encode('utf-8')))
+ msgstr)))
self._xml_err = ''
ctxt.doc().freeDoc()
return node
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <[email protected]>
Date: Mon, 9 Oct 2023 14:26:43 +0200
Subject: [PATCH] Fix insufficiently quoted regular expressions

These went under the radar until Python 3.12 started warning about them.

Signed-off-by: Nils Philippsen <[email protected]>
---
itstool.in | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/itstool.in b/itstool.in
index f34673581c88..8e8c657aa352 100755
--- a/itstool.in
+++ b/itstool.in
@@ -233,7 +233,7 @@ class Message (object):
if not isinstance(text, ustr_type):
text = ustr(text, 'utf-8')
self._message[-1] += text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
- if re.sub('\s+', ' ', text).strip() != '':
+ if re.sub(r'\s+', ' ', text).strip() != '':
self._empty = False

def add_entity_ref (self, name):
@@ -331,7 +331,7 @@ class Message (object):
message += '<_:%s-%i/>' % (msg.name, placeholder)
placeholder += 1
if not self._preserve:
- message = re.sub('\s+', ' ', message).strip()
+ message = re.sub(r'\s+', ' ', message).strip()
return message

def get_preserve_space (self):
@@ -469,9 +469,9 @@ class LocNote (object):
if self._preserve_space:
return self.locnote
else:
- return re.sub('\s+', ' ', self.locnote).strip()
+ return re.sub(r'\s+', ' ', self.locnote).strip()
elif self.locnoteref is not None:
- return '(itstool) link: ' + re.sub('\s+', ' ', self.locnoteref).strip()
+ return '(itstool) link: ' + re.sub(r'\s+', ' ', self.locnoteref).strip()
return ''


@@ -902,7 +902,7 @@ class Document (object):
trans = translations.ugettext('_\x04translator-credits')
if trans is None or trans == 'translator-credits':
return
- regex = re.compile('(.*) \<(.*)\>, (.*)')
+ regex = re.compile(r'(.*) \<(.*)\>, (.*)')
for credit in trans.split('\n'):
match = regex.match(credit)
if not match:
@@ -937,7 +937,7 @@ class Document (object):
prevnode = None
if node.prev is not None and node.prev.type == 'text':
prevtext = node.prev.content
- if re.sub('\s+', '', prevtext) == '':
+ if re.sub(r'\s+', '', prevtext) == '':
prevnode = node.prev
for lang in sorted(list(translations.keys()), reverse=True):
locale = self.get_its_locale_filter(node)
@@ -1481,7 +1481,7 @@ def match_locale(extrange, locale):
localei += 1
return True

-_locale_pattern = re.compile('([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
+_locale_pattern = re.compile(r'([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
def convert_locale (locale):
# Automatically convert POSIX-style locales to BCP47
match = _locale_pattern.match(locale)
31 changes: 31 additions & 0 deletions recipes/itstool/0003-Fix-handling-of-untranslated-nodes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Harald van Dijk <[email protected]>
Date: Thu, 15 Jun 2023 23:18:11 +0100
Subject: [PATCH] Fix handling of untranslated nodes

If a translation is missing, get_translated returns the node it was
called with. But ph_node when passed to get_translated is part of
another document and cannot just be reparented, it needs to be cloned.
The reparenting leaves things in an inconsistent state where references
intended to refer to nodes in the original document no longer do so, and
they may then be accessed from those references after the new document
has already been freed.

Fixes bug #36.
---
itstool.in | 2 ++
1 file changed, 2 insertions(+)

diff --git a/itstool.in b/itstool.in
index 8e8c657aa352..0e273b4c5bfa 100755
--- a/itstool.in
+++ b/itstool.in
@@ -1109,6 +1109,8 @@ class Document (object):
child.replaceNode(newnode)
else:
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
+ if repl == ph_node:
+ repl = repl.copyNode(1)
child.replaceNode(repl)
scan_node(child)
try:
Loading
Loading