Add language support for `pkg-config` by Alhadis · Pull Request #7991 · github-linguist/linguist · GitHub
Skip to content

Add language support for pkg-config#7991

Merged
lildude merged 6 commits into
mainfrom
pkg-config
Jun 4, 2026
Merged

Add language support for pkg-config#7991
lildude merged 6 commits into
mainfrom
pkg-config

Conversation

@Alhadis

@Alhadis Alhadis commented May 29, 2026

Copy link
Copy Markdown
Collaborator

This pull-request adds language support for pkg-config manifests.

Description

pkg-config (and its successor, pkgconf) are build utilities for managing project dependencies, compiler options, and other auxiliary information pertaining to installed software libraries. The file format these tools use is well-established and typically installed to directories like /usr/local/share/pkgconfig/.

The .pc filename suffix is also used by a number of other filetypes whose usage satisfies Linguist's popularity criteria:

makefile.pc
Makefiles, typically with rules targeting PC platforms.
README.pc
Project documentation specific to Windows, OS/2 and MS-DOS.
Oracle Pro*C/C++
A superset of C/C++ with embedded SQL statements that uses .pc as its file extension.

Checklist

  • I am adding a new language.
    • The extensions of the new language are used in hundreds of repositories:
    • I have included real-world usage samples for each extension:
    • I have included updated a syntax highlighting grammar:
      Alhadis/language-etc was bumped to 1137dbc
    • I have added a colour:
      • pkg-config: #75b5aa #2b5e82
        This was selected at random, as neither the pkg-config nor pkgconf projects have dedicated logos or branding from which to source a colour.
        UPDATE: As per @Nixinova's suggestion, I've changed it to the colour used by FreeDesktop.org's logo.
      • Oracle Pro*C: #bb8368
        This was sampled from Larry Ellison's forehead:
    • I have updated the heuristics.
      • pkg-config: Manifests are required to include Name:, Description: and Version: fields1 (albeit not necessarily in that order).
      • Pro*C: Embedded SQL statements all start with EXEC SQL.2

Footnotes

  1. https://github.com/pkgconf/pkgconf/blob/32152be3498f0d9c38dec63ab11a7ae59726db90/man/pc.5#L82-L90

  2. https://docs.oracle.com/cd/E11882_01/appdev.112/e10825/pc_02prc.htm#i10149 The only special requirement for building SQL statements into your host program is that you begin them with the keywords EXEC SQL and end them with a semicolon.

Alhadis added 4 commits May 29, 2026 11:09
Since the samples database is generated using the pathname of the sample
file's directory, the array of languages passed to `Classifier.classify`
needs to use the filesystem-safe version of a language's name.
@Alhadis Alhadis requested a review from a team as a code owner May 29, 2026 07:11
@Alhadis Alhadis requested a review from lildude May 29, 2026 07:11
@lildude

lildude commented May 29, 2026

Copy link
Copy Markdown
Member

@Nixinova

Copy link
Copy Markdown
Contributor

hilarious colour justification lol.
However wouldn't #c84431 (from oracle's logo) for Pro*C and #2b5e82 (from freesoftware page, linked from wikipedia infobox for pcg-config be more justifiable.

@Nixinova

Copy link
Copy Markdown
Contributor

@havocp if you had to pick a colour to represent pkg-config what would it be

@havocp

havocp commented Jun 2, 2026

Copy link
Copy Markdown

@havocp if you had to pick a colour to represent pkg-config what would it be

Not a question I have ever considered 😀 probably not forehead color!

@Alhadis

Alhadis commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@lildude lildude added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 3560e27 Jun 4, 2026
9 checks passed
@lildude lildude deleted the pkg-config branch June 4, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants