Code Monkey home page Code Monkey logo

librepcb-api's Introduction

LibrePCB

Become a Patron Discourse Telegram Website Docs

Azure Build Status OpenSSF Best Practices

Packaging status

About LibrePCB

LibrePCB is a free EDA suite to develop printed circuit boards on Windows, Linux and MacOS. More information and screenshots are available at librepcb.org.

Installation & Usage

Official stable releases are provided at our download page.

Please read our user manual to see how you can install and use LibrePCB. The quickstart tutorial provides a step-by-step guide through the whole process of designing a PCB.

Contributing

Contributions are welcome! See librepcb.org/contribute and CONTRIBUTING.md for details.

For internal details take a look at the developers documentation.

Development

WARNING: The master branch always contains the latest UNSTABLE version of LibrePCB. Everything you do with this unstable version could break your workspace, libraries or projects, so you should not use it productively! For productive use, please install an official release as described in the user manual. For development, please read details here.

Requirements

To compile and run LibrePCB, you need the following software components:

  • Compiler: g++, MinGW or Clang (any version with C++17 support should work)
  • Qt >= 6.2 or 5.12...5.15 (make sure the imageformats plugin is installed too as it will be needed at runtime!).
  • OpenCASCADE OCCT or OCE (optional, OCCT highly preferred)
  • OpenGL Utility Library GLU (optional)
  • zlib
  • OpenSSL
  • CMake 3.16 or newer

Prepared Docker Image

Instead of installing the dependencies manually on your system (see instructions below), you can also use one of our Docker images with all dependencies pre-installed (except GUI tools like QtCreator). These images are actually used for CI, but are also useful to build LibrePCB locally.

Installation on Debian/Ubuntu/Mint

Ubuntu >= 22.04
sudo apt-get install build-essential git cmake openssl zlib1g zlib1g-dev \
     qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools \
     libqt6core5compat6-dev qt6-declarative-dev libqt6opengl6-dev libqt6svg6-dev \
     qt6-image-formats-plugins libglu1-mesa-dev libtbb-dev libxi-dev \
     occt-misc libocct-*-dev
sudo apt-get install qtcreator # optional
Ubuntu 20.04
sudo apt-get install build-essential git cmake openssl zlib1g zlib1g-dev \
     qt5-default qtdeclarative5-dev qttools5-dev-tools qttools5-dev \
     qtquickcontrols2-5-dev libqt5opengl5-dev libqt5svg5-dev \
     qt5-image-formats-plugins libglu1-mesa-dev liboce-*-dev
sudo apt-get install qt5-doc qtcreator # optional

Installation on Arch Linux

sudo pacman -S base-devel git cmake openssl zlib desktop-file-utils shared-mime-info \
     qt6-base qt6-5compat qt6-declarative qt6-svg qt6-tools qt6-imageformats opencascade
sudo pacman -S qt6-doc qtcreator # optional

Note: Instead of installing the dependencies and building LibrePCB manually, you could install the package librepcb-git from the AUR. The package clones and builds the latest version of the master branch from GitHub.

Installation on Mac OS X

  1. Install Xcode through the app store and start it at least once (for the license)
  2. Install homebrew (the package manager)
  3. Install dependencies: brew update && brew install qt6 cmake opencascade
  4. Make the toolchain available: brew unlink qt && brew link --force qt6

Installation on Windows

Download and run the Qt for Windows installer from here. LibrePCB does not compile with MSVC, so you must install following components with the Qt installer:

  • MinGW 11.2.0 64-bit compiler
  • Qt binaries for MinGW 11.2.0 64-bit (use the latest 6.x version)
  • Qt 5 Compatibility Module for MinGW 11.2.0 64-bit
  • Qt Image Formats for MinGW 11.2.0 64-bit
  • CMake

For the OpenCascade library the installation procedure is not that easy unfortunately. Basically you have to build it by yourself, see instructions here. However, to avoid this effort you could instead just set the CMake option USE_OPENCASCADE=0 (can be set in the QtCreator build config) to allow compiling LibrePCB without OpenCascade.

Cloning

It's important to clone the repository recursively to get all submodules too:

git clone --recursive https://github.com/LibrePCB/LibrePCB.git && cd LibrePCB

Updating

When updating the repository, make sure to also update all the submodules recursively. Otherwise you may get strange compilation errors:

git submodule update --init --recursive

Building

You can either build LibrePCB using Qt Creator, or you can build on the command line using cmake. To build LibrePCB using cmake/make:

mkdir build && cd build
cmake ..
make -j8

The binary can then be found in build/apps/librepcb/.

For more detailed instructions (including how to set up Qt Creator), see https://developers.librepcb.org/d5/d96/doc_building.html

Credits

  • First of all, many thanks to all of our contributors!
  • A big thank you goes to all our sponsors which help to keep this project alive!
  • Special thanks also to cloudscale.ch for sponsoring our API server!

License

LibrePCB is published under the GNU GPLv3 license.

librepcb-api's People

Contributors

dbrgn avatar ubruhin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

librepcb-api's Issues

Use GitHub repository as server?

Just a stupid question:
Why not simply create a repository on GitHub, create a json file in it, and redirect https://api.librepcb.org/v1/libraries to that file? As we do not yet need to transfer data from the application to the server, this should be enough for the beginning.

Advantages:

  • KISS - much less complexity!
  • Transparency - Everyone can see how it works and who has changed which library and when.
  • Everyone can ask for adding or updating a library just by creating a pull request (cool, isn't it?).
  • We also need a way to provide library icons (*.png) - GitHub can do this too, just check in the icons.

Opinions?

Update json library objects

Current response for GET /api/v1/libraries/:

{
    "uuid": "d0ff7c29-ef27-468a-a90e-518083b3d8e4",
    "name": "Base",
    "url": "git://github.com/librepcb-libraries/base",
    "publisher": {
        "name": "LibrePCB"
    },
    "dependencies": [
        "5a27a376-f1d9-4fac-a695-ef64d7c7012c"
    ]
}

Issues:

  1. Missing multilingual support
  2. Missing attributes: format_version, version, author, deprecated, download_url, description, keywords, image
  3. Attribute publisher is no longer required

New json notation (proposal):

{
    "uuid": "d0ff7c29-ef27-468a-a90e-518083b3d8e4",
    "format_version": "0.1",
    "version": "0.0.1",
    "author": "LibrePCB",
    "deprecated": false,
    "url": "https://github.com/LibrePCB-Libraries/LibrePCB_Base.lplib",
    "download_url": "https://github.com/LibrePCB-Libraries/LibrePCB_Base.lplib/archive/master.zip",
    "image": "????",
    "name": {
        "en_US": "LibrePCB Base"
    },
    "description": {
        "en_US": "Official LibrePCB Base Library"
    },
    "keywords": {
        "en_US": ""
    },
    "dependencies": [
        "5a27a376-f1d9-4fac-a695-ef64d7c7012c"
    ]
}

Open questions:

  • Libraries can have an image in their root directory, and this image should also be available through this API. In my opinion it would be best to use SVG images because they are only text files and thus suitable for version control. But how to deliver them with the API?
    • Compress the SVG file and put it as a Base64 encoded string into the library json object?
    • Convert the SVG to PNG and put it as a Base64 encoded string into the library json object?
    • Do not embed the image into the API response (e.g. only deliver an URL where the image can be downloaded separately)?
  • Add the checksum of the library ZIP archives to the json object? This way we could make sure that the downloaded ZIP archive is equal to the one which was originally registered on the API server. If the hoster of a ZIP archive would silently replace an archive without registering this on our API server, LibrePCB would refuse to install that library.

Take application version into account when delivering a list of libraries

Currently the API response of /api/v1/libraries contains all available libraries, no matter what file version they have. So if you use an older application version (e.g. with file format v0.1), you also get libraries with a newer file format (e.g. v0.2). But the application can't open these libraries because of the changed file format.

So the client (i.e. the application) needs to specify its version when asking the server for libraries. I think we can do this by using HTTP headers, for example:

X-LibrePCB-AppVersion: 0.1
X-LibrePCB-AppGitHash: 0385957012d0a103fc56d08dd55fe0b7c466710f

With this information, the server can filter out incompatible libraries in its response.

@dbrgn Would you agree with that? Is this functionality supported by the Django REST Framework?

TLS Certificates

To create the TLS certificate, I need to verify the domain.

@ubruhin I contacted you directly for details.

SMTP

@ubruhin can you send me valid SMTP credentials for the server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.