Skip to content

Commit

Permalink
reuse: init reuse folder
Browse files Browse the repository at this point in the history
Do reuse init folder with LGPLv3+ license
and custom template for copyright.
This is the main, and default license
for this project.

With reuse all copyright headers will be changed
to SPDX format, while taking these considerations:
- Avoid years in the copyright lines to ease maintenance
- Avoid duplication, remove current copyright headers
- Keep copyright holder intact
- Change files to the new license (GPL vs LGPL)

Make sure the reuse linter passes the license check.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
  • Loading branch information
aesteve-rh committed Nov 20, 2023
1 parent ec9fa1f commit 94c2236
Show file tree
Hide file tree
Showing 20 changed files with 352 additions and 147 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# SPDX-FileCopyrightText: 2023 Albert Esteve <aesteve@redhat.com>
# SPDX-License-Identifier: LGPL-3.0-or-later

/target
**/__pycache__
10 changes: 10 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vhal_emulator
Upstream-Contact: Albert Esteve <aesteve@redhat.com>
Source: https://github.com/aesteve-rh/vhal_emulator

# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
6 changes: 6 additions & 0 deletions .reuse/templates/vhal_emulator.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}
2 changes: 2 additions & 0 deletions Cargo.lock.license

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2023 Albert Esteve <aesteve@redhat.com>
# SPDX-License-Identifier: LGPL-3.0-or-later

[package]
name = "vhal_emulator"
version = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion LICENSES/APACHE-2.0.txt → LICENSES/Apache-2.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
117 changes: 0 additions & 117 deletions LICENSES/GPL-2.0-or-later.txt

This file was deleted.

304 changes: 304 additions & 0 deletions LICENSES/LGPL-3.0-or-later.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-License-Identifier: LGPL-3.0-or-later

VENV_DIR = $(HOME)/.venv/vhal_emulator
VENV = $(VENV_DIR)/bin
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
SPDX-FileCopyrightText: 2023 Albert Esteve <aesteve@redhat.com>
SPDX-License-Identifier: LGPL-3.0-or-later
-->

# VHAL Host Emulator

Based on Google's [VHAL Emulator](https://android.googlesource.com/platform/packages/services/Car/+/refs/heads/main/tools/emulator/).
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: Red Hat, Inc.
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-License-Identifier: LGPL-3.0-or-later

fn main() {
protobuf_codegen::Codegen::new()
Expand Down
3 changes: 3 additions & 0 deletions rusfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2023 Albert Esteve <aesteve@redhat.com>
# SPDX-License-Identifier: LGPL-3.0-or-later

edition = "2018"
format_generated_files = false
format_code_in_doc_comments = true
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/data/types.hal.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (C) 2016 The Android Open Source Project
SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion src/codegen/gen_vhal_const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-License-Identifier: LGPL-3.0-or-later

from pathlib import Path
from datetime import datetime
Expand Down
24 changes: 3 additions & 21 deletions src/codegen/hidl_parser.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#!/usr/bin/env python3
#

# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# A parser for enum types defined in HIDL.
# This script can parse HIDL files and generate a parse tree.
# To use, import and call parse("path/to/file.hal")
# It will return a Python dictionary with three keys:
# - header: an instance of Header
# - enums: a dictionary of EnumDecl objects by name
# - structs: a dictionary of StructDecl objects by name
# It requires 'ply' (Python Lex/Yacc).
# SPDX-License-Identifier: Apache-2.0

from __future__ import print_function
import ply
tokens = ('package', 'import', 'enum', 'struct', 'typedef',
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-License-Identifier: LGPL-3.0-or-later

ply
mako
2 changes: 1 addition & 1 deletion src/codegen/vhal_consts_2_0.rs.mako
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: Red Hat, Inc.
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-License-Identifier: LGPL-3.0-or-later

// This file is generated by gen_vhal_const.py. Do not edit
// .hal file is parsed by hidl_parser.py
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: Red Hat, Inc.
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-License-Identifier: LGPL-3.0-or-later

include!(concat!(env!("OUT_DIR"), "/protos/mod.rs"));

Expand Down
2 changes: 2 additions & 0 deletions src/protos/VehicleHalProto.proto.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (C) 2015 The Android Open Source Project
SPDX-License-Identifier: Apache-2.0
4 changes: 2 additions & 2 deletions src/vhal_consts_2_0.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-FileCopyrightText: Red Hat, Inc.
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-License-Identifier: LGPL-3.0-or-later

// This file is generated by gen_vhal_const.py. Do not edit
// .hal file is parsed by hidl_parser.py
// Source file copied from hardware/interfaces/automotive/vehicle/2.0/types.hal
// File generated on: 2023-11-13
// File generated on: 2023-11-20

#![allow(dead_code)]
#![allow(non_snake_case)]
Expand Down

0 comments on commit 94c2236

Please sign in to comment.